X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=modules%2Fganeti2%2Fmanifests%2Finit.pp;h=cf658fc5885f72714682c0654b6155802ca15e39;hb=a68ac2a388955f929b49474adfc31c2bf985258b;hp=4cbd7d5e704f182c8586d8bb60a5863ce8667397;hpb=23b4b5adae9a75e3fcb27261b559b2fb497f85c3;p=dsa-puppet.git diff --git a/modules/ganeti2/manifests/init.pp b/modules/ganeti2/manifests/init.pp index 4cbd7d5e..cf658fc5 100644 --- a/modules/ganeti2/manifests/init.pp +++ b/modules/ganeti2/manifests/init.pp @@ -1,6 +1,19 @@ +# = Class: ganeti2 +# +# Standard ganeti2 config debian.org hosts +# +# == Sample Usage: +# +# include ganeti2 +# class ganeti2 { - package { 'ganeti2': + include ganeti2::params + include ganeti2::firewall + + $drbd = $ganeti2::params::drbd + + package { 'ganeti': ensure => installed } @@ -12,82 +25,59 @@ class ganeti2 { ensure => installed } - case $::cluster { - 'ganeti2.debian.org': { - package { 'drbd8-utils': - ensure => installed - } - - @ferm::rule { 'dsa-ganeti-noded-v4': - 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; }', - notarule => true, - } - - @ferm::rule { 'dsa-ganeti-confd-v4': - 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; }', - notarule => true, - } - - @ferm::rule { 'dsa-ganeti-rapi-v4': - 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; }', - 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; }', - notarule => true, - } - - @ferm::rule { 'dsa-ganeti-ssh-v4': - description => 'allow ganeti to ssh around', - rule => 'proto tcp dport ssh @subchain \'ganeti-ssh\' { saddr ( $HOST_GANETI_V4 $HOST_GANETI_BACKEND_V4) ACCEPT; }', - notarule => true, - } + if $drbd { + package { 'drbd8-utils': + ensure => installed } } + site::linux_module { 'tun': } + file { '/etc/ganeti/instance-debootstrap/variants.list': content => template('ganeti2/instance-debootstrap/variants.list.erb'), + require => Package['ganeti-instance-debootstrap'], ; '/etc/ganeti/instance-debootstrap/variants/dsa.conf': content => template('ganeti2/instance-debootstrap/variants/dsa.conf.erb'), + require => Package['ganeti-instance-debootstrap'], + ; + '/etc/ganeti/instance-debootstrap/variants/dsa-wheezy.conf': + content => template('ganeti2/instance-debootstrap/variants/dsa-wheezy.conf.erb'), + require => Package['ganeti-instance-debootstrap'], ; '/etc/ganeti/instance-debootstrap/hooks/00-dsa-configure-networking': content => template('ganeti2/instance-debootstrap/hooks/00-dsa-configure-networking.erb'), - mode => '0555', + require => Package['ganeti-instance-debootstrap'], + mode => '0555', ; '/etc/ganeti/instance-debootstrap/hooks/10-dsa-install-extra-packages': content => template('ganeti2/instance-debootstrap/hooks/10-dsa-install-extra-packages.erb'), - mode => '0555', + require => Package['ganeti-instance-debootstrap'], + mode => '0555', ; '/etc/ganeti/instance-debootstrap/hooks/20-dsa-install-bootloader': content => template('ganeti2/instance-debootstrap/hooks/20-dsa-install-bootloader.erb'), - mode => '0555', + require => Package['ganeti-instance-debootstrap'], + mode => '0555', ; '/etc/ganeti/instance-debootstrap/hooks/30-dsa-install-ssh-keys': content => template('ganeti2/instance-debootstrap/hooks/30-dsa-install-ssh-keys.erb'), - mode => '0555', + require => Package['ganeti-instance-debootstrap'], + mode => '0555', ; '/etc/ganeti/instance-debootstrap/hooks/40-dsa-setup-swapfile': content => template('ganeti2/instance-debootstrap/hooks/40-dsa-setup-swapfile.erb'), - mode => '0555', + require => Package['ganeti-instance-debootstrap'], + mode => '0555', ; '/etc/ganeti/instance-debootstrap/hooks/clear-root-password': - mode => '0444', + require => Package['ganeti-instance-debootstrap'], + mode => '0444', ; '/etc/ganeti/instance-debootstrap/hooks/xen-hvc0': - mode => '0444', + require => Package['ganeti-instance-debootstrap'], + mode => '0444', ; }