bloomberg / consul-cluster-cookbook

Wrapper cookbook which installs and configures a Consul cluster.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Specifying start_join in wrapper cookbook recipe fails to populate consul.json

boydj opened this issue · comments

If I specify override in attributes/default.rb, the override takes place and the IPs show up in consul.json.

If I specify the attribute in recipes/default.rb, the attributes show up with knife show, but not in consul.json.

Example...

vault_nodes=search(:node, 'recipes:"role-vault-server" AND chef_environment:"' + node.chef_environment + '"')
vault_ips=vault_nodes.map(&:ipaddress)
node.default['consul']['config']['start_join'] = vault_ips

Results in knife show ...

consul:
config:
..
start_join:
10.0.0.1
10.0.0.2
10.0.0.3

But, they do not appear in /etc/consul/consul.json

I assume something screwy is happening here with poise? Any ideas?

My mistake, was setting the attributes after including the wrapped cookbook. Whoops.