-
Notifications
You must be signed in to change notification settings - Fork 289
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
Create resources not doing deep merging in hiera #382
Comments
@devopsprosiva how is your Hiera configured in terms of merge behaviour? Can you check Specifically, look for a line that should say: Also, it's worth checking this for better documentation: https://docs.puppetlabs.com/hiera/1/lookup_types.html#deep-merging-in-hiera--120 |
@poolski I've enabled Thanks for sharing the link. Quoting from that link, Here is my ---
:backends:
- yaml
:hierarchy:
- "nodes/%{::fqdn}"
- "environment/%{::environment}"
- "roles/%{::role}"
- global
:yaml:
# datadir is empty here, so hiera uses its defaults:
# - /etc/puppetlabs/code/hieradata on *nix
# - %CommonAppData%\PuppetLabs\code\hieradata on Windows
# When specifying a datadir, make sure the directory exists.
:datadir: "/etc/puppetlabs/code/hieradata/%{environment}"
:merge_behavior: deeper |
Here's my ---
:backends:
- json
:json:
:datadir: /etc/puppet/hiera
:hierarchy:
- nodes/%{::clientcert}
- clients/%{::clientprefix}/nodes/%{::hostname}
- clients/%{::clientprefix}/%{::roletype}/%{::envtype}
- clients/%{::clientprefix}/%{::roletype}
- roles/%{::roletype}
- envtype/%{::envtype}
- environments/%{::environment}
- "%{::domain}"
- base
:merge_behavior: deeper As for my checks and how they're defined:
{
"sensu::checks": {
"os-disks": {
"command": "check-disk.rb -w 90 -c 95",
"handlers": [
"default"
],
"high_flap_threshold": "20",
"interval": 300,
"low_flap_threshold": "5",
"refresh": 1209600,
"standalone": true
},
"os-load": {
"command": "check-load.rb --per-core",
"handlers": [
"default"
],
"high_flap_threshold": "20",
"interval": 30,
"low_flap_threshold": "5",
"refresh": 1209600,
"standalone": true
},
"os-memory": {
"command": "check-ram.rb",
"handlers": [
"default"
],
"high_flap_threshold": "20",
"interval": 60,
"low_flap_threshold": "5",
"refresh": 1209600,
"standalone": true
}
}
}
{
"sensu::checks": {
"node-specific-check": {
"command": "check-something.rb",
"handle": false,
"handlers": [
"IM"
],
"interval": 30,
"refresh": 3600,
"standalone": false,
"subscribers": [
"specialsnowflakes"
]
}
} Does that help a little? *tl;dr: you need to make sure that the |
@poolski I tried having configuration similar to yours, but it's still not working.
---
# Node classification
classes:
- ntp
- roles::sensu::client::core
# Sensu client settings
sensu::client: true
sensu::sensu_plugin_provider: 'sensu_gem'
sensu::sensu_plugin_version: 'present'
sensu::use_embedded_ruby: true
sensu::rabbitmq_host: 'sensuserver'
sensu::rabbitmq_port: '5672'
sensu::rabbitmq_user: 'sensu'
sensu::rabbitmq_vhost: 'sensu'
sensu::rabbitmq_password: 'sensu'
sensu::purge_config: true
sensu::checks:
'check_cpu':
command: '/etc/sensu/plugins/check-cpu.rb -w 75 -c 90'
handlers: 'mail'
# Add sensu plugins
sensu::plugins:
- "puppet:///modules/profiles/sensu/plugins/http/check-http.rb"
- "puppet:///modules/profiles/sensu/plugins/system/check-cpu.rb"
- "puppet:///modules/profiles/sensu/plugins/system/check-ram.rb"
- "puppet:///modules/profiles/sensu/plugins/processes/check-procs.rb"
# Add sensu checks
sensu::checks:
'check_ram':
command: '/etc/sensu/plugins/check-ram.rb -c 5'
handlers: 'mail'
'check_tomcat':
command: '/etc/sensu/plugins/check-procs.rb -p tomcat -C 1'
handlers: 'mail'
|
I'm going to go ahead and close this issue as there hasn't been any traffic on it. If there are issues with this module, please re-open this issue or create a new one. |
Hi,
I use hiera to classify nodes and push plugins and checks to the sensu clients. However if I specify common checks in my global.yaml they are not being applied to the client. Only the checks defined in the client specific hiera files are being applied. As a result, I've to define the same checks in all the client hiera files. Is there anyway to enable deep merging so I can define all the common checks and plugins in the global.yaml file?
Thanks in advance.
Siva
The text was updated successfully, but these errors were encountered: