From: Peter Palfrader Date: Sat, 28 Sep 2019 08:23:26 +0000 (+0200) Subject: Get pubsub nodes from puppetdb X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=ec0a5928c34bafcfd6bb24dbd1d99c4c814ae8ff;p=mirror%2Fdsa-puppet.git Get pubsub nodes from puppetdb --- diff --git a/modules/roles/manifests/pubsub.pp b/modules/roles/manifests/pubsub.pp index 1312a4baa..20554ece2 100644 --- a/modules/roles/manifests/pubsub.pp +++ b/modules/roles/manifests/pubsub.pp @@ -4,15 +4,13 @@ class roles::pubsub { $cluster_cookie = $roles::pubsub::params::cluster_cookie - $cc_master = rainier - $cc_secondary = rapoport + # Get the fact named hostname from all nodes in puppetdb with class Roles::Pubsub + $query = 'facts { name = "hostname" and resources { type = "Class" and title = "Roles::Pubsub" } }' + $cluster_nodes = sort(puppetdb_query($query).map |$value| { $value["value"] }) class { 'rabbitmq': config_cluster => true, - cluster_nodes => [ - $cc_master, - $cc_secondary, - ], + cluster_nodes => $cluster_nodes, cluster_node_type => 'disc', erlang_cookie => '8r17so6o1s124ns49sr08n0o24342160', delete_guest_user => true,