]> git.donarmstrong.com Git - dsa-puppet.git/commitdiff
make drbd rule conditional
authorStephen Gran <steve@lobefin.net>
Tue, 11 Sep 2012 19:22:29 +0000 (20:22 +0100)
committerStephen Gran <steve@lobefin.net>
Tue, 11 Sep 2012 19:22:29 +0000 (20:22 +0100)
Signed-off-by: Stephen Gran <steve@lobefin.net>
modules/ganeti2/manifests/firewall.pp

index 484ac80eca671bd03426b6d273ef5f017fcc13dd..8cb253d0aee6b7bed9503577876930d10df7d3fb 100644 (file)
@@ -4,6 +4,7 @@ class ganeti2::firewall {
 
        $ganeti_hosts = $ganeti2::params::ganeti_hosts
        $ganeti_priv  = $ganeti2::params::ganeti_priv
+       $drbd         = $ganeti2::params::drbd
 
        @ferm::conf { 'ganeti2':
                content => template('ganeti2/defs.conf.erb')
@@ -27,12 +28,6 @@ class ganeti2::firewall {
                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':
                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; }',
@@ -44,4 +39,12 @@ class ganeti2::firewall {
                rule        => 'proto tcp dport ssh @subchain \'ganeti-ssh\' { saddr ( $HOST_GANETI_V4 $HOST_GANETI_BACKEND_V4) ACCEPT; }',
                notarule    => true,
        }
+
+       if $drbd {
+               @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,
+               }
+       }
 }