From: Peter Palfrader Date: Sun, 18 Nov 2018 09:25:51 +0000 (+0100) Subject: Try to not limit ganeti firewall rules to v4 X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=78b189946eb7b50e5b216f57ed392d307277f442;p=mirror%2Fdsa-puppet.git Try to not limit ganeti firewall rules to v4 --- diff --git a/modules/ganeti2/manifests/firewall.pp b/modules/ganeti2/manifests/firewall.pp index 8cb253d0a..74418027d 100644 --- a/modules/ganeti2/manifests/firewall.pp +++ b/modules/ganeti2/manifests/firewall.pp @@ -10,40 +10,46 @@ class ganeti2::firewall { content => template('ganeti2/defs.conf.erb') } - @ferm::rule { 'dsa-ganeti-noded-v4': + @ferm::rule { 'dsa-ganeti-noded': description => 'allow ganeti-noded communication', - rule => 'proto tcp mod state state (NEW) dport (1811) @subchain \'ganeti-noded\' { saddr ($HOST_GANETI_V4) daddr ($HOST_GANETI_V4) ACCEPT; }', + domain => '(ip ip6)', + rule => 'proto tcp mod state state (NEW) dport (1811) @subchain \'ganeti-noded\' { saddr ($HOST_GANETI) daddr ($HOST_GANETI) ACCEPT; }', notarule => true, } - @ferm::rule { 'dsa-ganeti-confd-v4': + @ferm::rule { 'dsa-ganeti-confd': description => 'allow ganeti-confd communication', - rule => 'proto udp mod state state (NEW) dport (1814) @subchain \'ganeti-confd\' { saddr ($HOST_GANETI_V4) daddr ($HOST_GANETI_V4) ACCEPT; }', + domain => '(ip ip6)', + rule => 'proto udp mod state state (NEW) dport (1814) @subchain \'ganeti-confd\' { saddr ($HOST_GANETI) daddr ($HOST_GANETI) ACCEPT; }', notarule => true, } - @ferm::rule { 'dsa-ganeti-rapi-v4': + @ferm::rule { 'dsa-ganeti-rapi': description => 'allow ganeti-rapi communication', - rule => 'proto tcp mod state state (NEW) dport (5080) @subchain \'ganeti-rapi\' { saddr ($HOST_GANETI_V4) daddr ($HOST_GANETI_V4) ACCEPT; }', + domain => '(ip ip6)', + rule => 'proto tcp mod state state (NEW) dport (5080) @subchain \'ganeti-rapi\' { saddr ($HOST_GANETI) daddr ($HOST_GANETI) ACCEPT; }', notarule => true, } - @ferm::rule { 'dsa-ganeti-kvm-migration-v4': + @ferm::rule { 'dsa-ganeti-kvm-migration': description => 'allow ganeti kvm migration ', - rule => 'proto tcp dport 8102 @subchain \'ganeti-kvm-migration\' { saddr ($HOST_GANETI_BACKEND_V4) daddr ($HOST_GANETI_BACKEND_V4) ACCEPT; }', + domain => '(ip ip6)', + rule => 'proto tcp dport 8102 @subchain \'ganeti-kvm-migration\' { saddr ($HOST_GANETI_BACKEND) daddr ($HOST_GANETI_BACKEND) ACCEPT; }', notarule => true, } - @ferm::rule { 'dsa-ganeti-ssh-v4': + @ferm::rule { 'dsa-ganeti-ssh': description => 'allow ganeti to ssh around', - rule => 'proto tcp dport ssh @subchain \'ganeti-ssh\' { saddr ( $HOST_GANETI_V4 $HOST_GANETI_BACKEND_V4) ACCEPT; }', + domain => '(ip ip6)', + rule => 'proto tcp dport ssh @subchain \'ganeti-ssh\' { saddr ( $HOST_GANETI $HOST_GANETI_BACKEND) ACCEPT; }', notarule => true, } if $drbd { - @ferm::rule { 'dsa-ganeti-drbd-v4': + @ferm::rule { 'dsa-ganeti-drbd': description => 'allow ganeti drbd communication', - rule => 'proto tcp mod state state (NEW) dport (11000:11999) @subchain \'ganeti-drbd\' { saddr ($HOST_GANETI_BACKEND_V4) daddr ($HOST_GANETI_BACKEND_V4) ACCEPT; }', + domain => '(ip ip6)', + rule => 'proto tcp mod state state (NEW) dport (11000:11999) @subchain \'ganeti-drbd\' { saddr ($HOST_GANETI_BACKEND) daddr ($HOST_GANETI_BACKEND) ACCEPT; }', notarule => true, } } diff --git a/modules/ganeti2/templates/defs.conf.erb b/modules/ganeti2/templates/defs.conf.erb index e1d68d2e0..0a075b27d 100644 --- a/modules/ganeti2/templates/defs.conf.erb +++ b/modules/ganeti2/templates/defs.conf.erb @@ -1,2 +1,2 @@ -@def $HOST_GANETI_V4 = (<%= scope.lookupvar('ganeti_hosts').to_a.flatten.join(' ') -%>); -@def $HOST_GANETI_BACKEND_V4 = (<%= scope.lookupvar('ganeti_priv').to_a.flatten.join(' ')-%>); +@def $HOST_GANETI = (<%= scope.lookupvar('ganeti_hosts').to_a.flatten.join(' ') -%>); +@def $HOST_GANETI_BACKEND = (<%= scope.lookupvar('ganeti_priv').to_a.flatten.join(' ')-%>);