sous-chefs / consul

Development repository for the consul cookbook

Home Page:https://supermarket.chef.io/cookbooks/consul

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ability to append environment variables for consul service via node attributes

vitali-zevako opened this issue · comments

Would be nice to have ability to append environment variables for consul service via node attributes

Example:

default['consul']['environment'] = {
    'CONSUL_HTTP_SSL' => 'true',
    ...
}

And result of it:
Environment="GOMAXPROCS=8" "PATH=/usr/local/bin:/usr/bin:/bin" "CONSUL_HTTP_SSL=true"

Hi @vitali-zevako,

It seems that CONSUL_HTTP_SSL env variable doesn't affect agent command. It makes sense only for user-faced commands, such as acl, members, kv and others (which are not covered by this cookbook), doesn't it?

For setting agent parameters, we recommend using config file options, which are managed by node['consul']['config'][<option_name>] attributes. That's the most straightforward way to pass any options to the agent.
Is there any significant reason to use env vars instead?

Hi @legal90,

You are right. it will not affect

I looked for a way to prevent set manually env vars for consul cli commands with this cookbook and expected it will work if i update env vars for service, but that is different things.

Thanks for explanation, i will close a ticket

commented

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.