Curator environment variables for hosts

How can I specify a list of hosts for curator's config file using an environment variable? I have the following in my curator-config.yml:


When I try something like:

$ ELASTICSEARCH_HOST=,, curator --config curator-config.yml

It times out. The debug output says that hosts gets set to one value in a list instead of three values, which seems wrong:

2018-04-10 15:40:18,700 DEBUG curator.utils get_client:803 kwargs = {'url_prefix': '', 'aws_secret_key': None, 'http_auth': None, 'certificate': None, 'aws_key': None, 'aws_sign_request': False, 'port': 9200, 'hosts': [',,'], 'timeout': 30, 'aws_token': None, 'use_ssl': False, 'master_only': False, 'client_cert': None, 'ssl_no_validate': False, 'client_key': None}

Is there a way to properly expand an environment variable into a list?

No, there is not. Your better bet is to have a single IP that points to a load balancing IP, or to deploy to all of your master eligible nodes, and set master_only: true in the client block. It will then only execute on the elected master node, and just exit without doing anything on the other nodes.

On a very odd chance this might work, you could have 3 environment variables:

    - ${HOST1:}
    - ${HOST2:}
    - ${HOST3:}

I've never tried this, but I can't imagine why this approach wouldn't work.

Thanks, pointing at a single IP is the strategy I settled on. I'm deploying curator in a docker container, and the de facto way of providing config to a container is via env vars (a la the official Elasticsearch containers)

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.