-
-
Notifications
You must be signed in to change notification settings - Fork 313
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
Watches key in config_hash should expect an array of hashes? #83
Comments
According to the tests it is a hash: It looks like the default is an empty hash and we are validating that it is as hash: But it looks like we lack docs on this. Can you make a PR that adds a docstring in the init.pp and maybe and example in README.md? Being a hash you would configure it like this: class { consul:
...
watches => {
'haproxy' => {
'key' => 'services/haproxy/',
'handler' => 'rebuild_haproxy.sh',
}
'sshd' => {
'key' => 'services/sshd',
'handler' => 'rebuild_sshd.sh',
}
}
services => {}
checks => {}
} Or in hiera it would be in yaml form. |
This causes a dependency loop: class { 'consul':
config_hash => {
'data_dir' => '/cust/consul',
'datacenter' => 'devint',
'log_level' => 'INFO',
'node_name' => "${fqdn}"
},
watches => {
'services' => {
'type' => 'services',
'handler' => 'sudo python /usr/local/bin/reacktor services'
},
'httpd_service' => {
'type' => 'service',
'service' => 'httpd',
'handler' => 'sudo python /usr/local/bin/reacktor service --service httpd'
},
'tomcat_service' => {
'type' => 'service',
'service' => 'tomcat',
'handler' => 'sudo python /usr/local/bin/reacktor service --service tomcat'
}
}
} err: Could not apply complete catalog: Found 1 dependency cycle: |
I'm having trouble reproducing your issue. So I've added a test case with exactly the input you provided. Here are the test results: |
@miroswan can you confirm you are running the latest version of the code? |
I'm running v0.4.6. I ended up overriding the config.json resource and templating it so I can avoid the aforementioned issue and gain a bit more more flexibility. Aside from the watches class param, the consul module has been working out just fine for me. If the tests are passing, I suppose it's fine to mark this one as closed for now. Possible PEBCAK on my end. |
Possibly. Can you try the tip of master and confirm that whatever bug that you are hitting is fixed? That way we can close this issue with confidence. |
Closing as this is an old issue and seems to be fixed. If not please re-open the issue. |
Hey, so. Looking at the consul configuration syntax, it looks like the watches value should be an array of hashes. Each watcher is a hash and indexed in an array. I'm not sure how to configure my watches using this puppet module since the watches key in the configuration hash is expecting a hash value instead of an array value. If this is by design, would you mind briefly explaining how to configure this key properly? Otherwise, this is probably a bug.
Thanks.
The text was updated successfully, but these errors were encountered: