X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fganeti2%2Fmanifests%2Ffirewall.pp;h=0314cc45c6c9222b1230e8e4fe2f3438118eb894;hb=ad5a5e1b27be7b1b76dba642da1de154cd95aaf3;hp=484ac80eca671bd03426b6d273ef5f017fcc13dd;hpb=e81d2dd357118ed7157fa2fa5107b57f28c3cdf0;p=mirror%2Fdsa-puppet.git diff --git a/modules/ganeti2/manifests/firewall.pp b/modules/ganeti2/manifests/firewall.pp index 484ac80ec..0314cc45c 100644 --- a/modules/ganeti2/manifests/firewall.pp +++ b/modules/ganeti2/manifests/firewall.pp @@ -4,44 +4,53 @@ class ganeti2::firewall { $ganeti_hosts = $ganeti2::params::ganeti_hosts $ganeti_priv = $ganeti2::params::ganeti_priv + $drbd = $ganeti2::params::drbd - @ferm::conf { 'ganeti2': + ferm::conf { 'ganeti2': 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-drbd-v4': - 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; }', - 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': + description => 'allow ganeti drbd communication', + 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, + } + } }