From e4b93be70ebed73230c20f3a943ed4829dfffd69 Mon Sep 17 00:00:00 2001 From: Aurelien Jarno Date: Sat, 28 Sep 2019 00:57:34 +0200 Subject: [PATCH] pubsub: do not hardcode IPs --- modules/roles/manifests/pubsub.pp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/modules/roles/manifests/pubsub.pp b/modules/roles/manifests/pubsub.pp index d165fccb5..324bac6e6 100644 --- a/modules/roles/manifests/pubsub.pp +++ b/modules/roles/manifests/pubsub.pp @@ -36,21 +36,14 @@ class roles::pubsub { } if $::hostname == $cc_master { - $you = '82.195.75.95' - $you6 = '2001:41b8:202:deb::311:95' + $other = join(getfromhash($deprecated::allnodeinfo, "${cc_secondary}.debian.org", 'ipHostNumber'), " ") } else { - $you = '82.195.75.94' - $you6 = '2001:41b8:202:deb::311:94' + $other = join(getfromhash($deprecated::allnodeinfo, "${cc_master}.debian.org", 'ipHostNumber'), " ") } ferm::rule { 'rabbitmq_cluster': - domain => 'ip', - description => 'rabbitmq cluster connections', - rule => "proto tcp mod state state (NEW) saddr (${you}) ACCEPT" - } - ferm::rule { 'rabbitmq_cluster_v6': - domain => 'ip6', + domain => '(ip ip6)', description => 'rabbitmq cluster connections', - rule => "proto tcp mod state state (NEW) saddr (${you6}) ACCEPT" + rule => "proto tcp mod state state (NEW) saddr (${other}) ACCEPT" } } -- 2.20.1