From ec0a5928c34bafcfd6bb24dbd1d99c4c814ae8ff Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Sat, 28 Sep 2019 10:23:26 +0200 Subject: [PATCH] Get pubsub nodes from puppetdb --- modules/roles/manifests/pubsub.pp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) 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, -- 2.20.1