Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Be more flexible on configuration accepted by this cookbook #410

Closed
kamaradclimber opened this issue Feb 8, 2017 · 2 comments · Fixed by #411
Closed

Be more flexible on configuration accepted by this cookbook #410

kamaradclimber opened this issue Feb 8, 2017 · 2 comments · Fixed by #411

Comments

@kamaradclimber
Copy link
Contributor

Whenever a new consul version is released, one need to patch libraries/consul_config.rb to extend the list of supported options.

This makes it a bit painful.

It is possible to do hacky stuff with the option_collector by reopening the resource but it is not really straightforward for most users.

Would it be possible to allow to specify new options without encountering:

undefined method `node_meta' for ConsulCookbook::Resource::ConsulConfig
kamaradclimber added a commit to criteo-forks/consul-cookbook that referenced this issue Feb 8, 2017
Simple sort compare key & values. It fails for hash values.

For instance:

```
{:data_dir=>"/var/lib/consul",
 :client_addr=>"0.0.0.0",
 :ports=>{"dns"=>-1, "http"=>8500, "rpc"=>8400, "serf_lan"=>8301, "serf_wan"=>8302, "server"=>8300},
 :enable_syslog=>false,
 :retry_join=>["consul01-par.kitchen"],
 :node_name=>"ip-10-0-64-236.us-west-2.compute.internal",
 :server=>false,
 :datacenter=>"par",
 :domain=>"consul",
 :addresses=>{"http"=>"0.0.0.0"},
 :acl_datacenter=>"par",
 :disable_update_check=>true,
 :leave_on_terminate=>false,
 :advertise_addr=>"10.0.64.236",
 :encrypt=>"/AKlGGZMMSUsJLit/+etBw==",
 :verify_incoming=>false,
 :verify_outgoing=>false,
 "node_meta"=>{"rack"=>nil}}
```

will raise `ArgumentError: comparison of Array with Array failed`.

Sorting by keys is sufficient

Fix sous-chefs#410

Change-Id: Ieaf05a019c4d636ae8457046ee4e3bf8f697296a
@kamaradclimber
Copy link
Contributor Author

Provided that #411 is merged, it is actually doable via attributes:

default['consul']['config']['options']['node_meta']['rack'] = 'myrack'

thx!

kamaradclimber added a commit to criteo-forks/consul-cookbook that referenced this issue Feb 8, 2017
Simple sort compare key & values. It fails for hash values.

For instance:

```
{:data_dir=>"/var/lib/consul",
 :client_addr=>"0.0.0.0",
 :ports=>{"dns"=>-1, "http"=>8500, "rpc"=>8400, "serf_lan"=>8301, "serf_wan"=>8302, "server"=>8300},
 :enable_syslog=>false,
 :retry_join=>["consul01-par.kitchen"],
 :node_name=>"ip-10-0-64-236.us-west-2.compute.internal",
 :server=>false,
 :datacenter=>"par",
 :domain=>"consul",
 :addresses=>{"http"=>"0.0.0.0"},
 :acl_datacenter=>"par",
 :disable_update_check=>true,
 :leave_on_terminate=>false,
 :advertise_addr=>"10.0.64.236",
 :encrypt=>"/AKlGGZMMSUsJLit/+etBw==",
 :verify_incoming=>false,
 :verify_outgoing=>false,
 "node_meta"=>{"rack"=>nil}}
```

will raise `ArgumentError: comparison of Array with Array failed`.

Sorting by keys is sufficient

Fix sous-chefs#410

Change-Id: Ieaf05a019c4d636ae8457046ee4e3bf8f697296a
legal90 pushed a commit to criteo-forks/consul-cookbook that referenced this issue Feb 9, 2017
Simple sort compare key & values. It fails for hash values.

For instance:

```
{:data_dir=>"/var/lib/consul",
 :client_addr=>"0.0.0.0",
 :ports=>{"dns"=>-1, "http"=>8500, "rpc"=>8400, "serf_lan"=>8301, "serf_wan"=>8302, "server"=>8300},
 :enable_syslog=>false,
 :retry_join=>["consul01-par.kitchen"],
 :node_name=>"ip-10-0-64-236.us-west-2.compute.internal",
 :server=>false,
 :datacenter=>"par",
 :domain=>"consul",
 :addresses=>{"http"=>"0.0.0.0"},
 :acl_datacenter=>"par",
 :disable_update_check=>true,
 :leave_on_terminate=>false,
 :advertise_addr=>"10.0.64.236",
 :encrypt=>"/AKlGGZMMSUsJLit/+etBw==",
 :verify_incoming=>false,
 :verify_outgoing=>false,
 "node_meta"=>{"rack"=>nil}}
```

will raise `ArgumentError: comparison of Array with Array failed`.

Sorting by keys is sufficient

Fix sous-chefs#410

Change-Id: Ieaf05a019c4d636ae8457046ee4e3bf8f697296a
kamaradclimber added a commit to criteo-forks/consul-cookbook that referenced this issue Feb 9, 2017
Simple sort compare key & values. It fails for hash values.

For instance:

```
{:data_dir=>"/var/lib/consul",
 :client_addr=>"0.0.0.0",
 :ports=>{"dns"=>-1, "http"=>8500, "rpc"=>8400, "serf_lan"=>8301, "serf_wan"=>8302, "server"=>8300},
 :enable_syslog=>false,
 :retry_join=>["consul01-par.kitchen"],
 :node_name=>"ip-10-0-64-236.us-west-2.compute.internal",
 :server=>false,
 :datacenter=>"par",
 :domain=>"consul",
 :addresses=>{"http"=>"0.0.0.0"},
 :acl_datacenter=>"par",
 :disable_update_check=>true,
 :leave_on_terminate=>false,
 :advertise_addr=>"10.0.64.236",
 :encrypt=>"/AKlGGZMMSUsJLit/+etBw==",
 :verify_incoming=>false,
 :verify_outgoing=>false,
 "node_meta"=>{"rack"=>nil}}
```

will raise `ArgumentError: comparison of Array with Array failed`.

Sorting by keys is sufficient

Fix sous-chefs#410

Change-Id: Ieaf05a019c4d636ae8457046ee4e3bf8f697296a
@lock
Copy link

lock bot commented Apr 25, 2020

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.

@lock lock bot locked as resolved and limited conversation to collaborators Apr 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant