From: Aurelien Jarno Date: Fri, 27 Sep 2019 22:57:34 +0000 (+0200) Subject: pubsub: do not hardcode IPs X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fdsa-puppet.git;a=commitdiff_plain;h=e4b93be70ebed73230c20f3a943ed4829dfffd69 pubsub: do not hardcode IPs --- 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" } }