bloomberg / consul-cluster-cookbook

Wrapper cookbook which installs and configures a Consul cluster.
Other
26 stars 20 forks source link

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

Closed boydj closed 8 years ago

boydj commented 8 years ago

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?

boydj commented 8 years ago

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