Last active
January 2, 2016 21:39
-
-
Save chriseckhardt/8365058 to your computer and use it in GitHub Desktop.
PUPPET Y U NO OVERRIDE?!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class profile::sensu::client { | |
class {'sensu': | |
use_embedded_ruby => true, | |
safe_mode => false, | |
client => true, | |
server => false, | |
api => false, | |
dashboard => false, | |
log_level => hiera('sensu::client::log_level', 'info'), | |
install_repo => hiera('sensu::client::install_repo', false), | |
api_host => hiera('sensu::client::api_host'), | |
api_port => hiera('sensu::client::api_port', 4567), | |
redis_host => hiera('sensu::client::redis_host'), | |
redis_port => hiera('sensu::client::redis_port', 6379), | |
rabbitmq_user => hiera('sensu::client::rabbitmq_user'), | |
rabbitmq_password => hiera('sensu::client::rabbitmq_password'), | |
rabbitmq_host => hiera('sensu::client::rabbitmq_host'), | |
rabbitmq_port => hiera('sensu::client::rabbitmq_port', 5671), | |
rabbitmq_vhost => hiera('sensu::client::rabbitmq_vhost', '/sensu'), | |
rabbitmq_ssl_private_key => hiera('sensu::client::rabbitmq_ssl_key', undef), | |
rabbitmq_ssl_cert_chain => hiera('sensu::client::rabbitmq_ssl_cert', undef), | |
# Doesn't matter if this is undef, empty or omitted, subclass override won't work. | |
subscriptions => undef, | |
} | |
class profile::sensu::openstack inherits profile::sensu::client { | |
Class['sensu'] { | |
subscriptions => [ | |
'ceilometer', | |
'glance', | |
'heat', | |
'keystone', | |
'neutron', | |
'rabbitmq' | |
], | |
} | |
} | |
# This yields empty array for the target subscriptions parameter in /etc/sensu/conf.d/client.json: | |
{ | |
"client": { | |
"address": "123.456.789.1", | |
"subscriptions": [ | |
], | |
"name": "centos.devstack.localdomain", | |
"safe_mode": false | |
} | |
} | |
# But this works and generates the desired array: | |
class profile::openstack::sensu::client { | |
class {'sensu': | |
use_embedded_ruby => true, | |
safe_mode => false, | |
client => true, | |
server => false, | |
api => false, | |
dashboard => false, | |
log_level => hiera('sensu::client::log_level', 'info'), | |
install_repo => hiera('sensu::client::install_repo', false), | |
api_host => hiera('sensu::client::api_host'), | |
api_port => hiera('sensu::client::api_port', 4567), | |
redis_host => hiera('sensu::client::redis_host'), | |
redis_port => hiera('sensu::client::redis_port', 6379), | |
rabbitmq_user => hiera('sensu::client::rabbitmq_user'), | |
rabbitmq_password => hiera('sensu::client::rabbitmq_password'), | |
rabbitmq_host => hiera('sensu::client::rabbitmq_host'), | |
rabbitmq_port => hiera('sensu::client::rabbitmq_port', 5671), | |
rabbitmq_vhost => hiera('sensu::client::rabbitmq_vhost', '/sensu'), | |
rabbitmq_ssl_private_key => hiera('sensu::client::rabbitmq_ssl_key', undef), | |
rabbitmq_ssl_cert_chain => hiera('sensu::client::rabbitmq_ssl_cert', undef), | |
subscriptions => [ | |
'ceilometer', | |
'glance', | |
'heat', | |
'keystone', | |
'neutron', | |
'rabbitmq' | |
], | |
} | |
# cat /etc/sensu/conf.d/client.json | |
{ | |
"client": { | |
"subscriptions": [ | |
"ceilometer", | |
"glance", | |
"heat", | |
"keystone", | |
"neutron", | |
"rabbitmq" | |
], | |
"safe_mode": false, | |
"address": "123.456.789.1", | |
"name": "centos.devstack.localdomain" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment