X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fganeti2%2Fmanifests%2Finit.pp;h=1708ba8570ccfccf92eab05f33ceca7a9617dd79;hb=5f6e8eec603529861ba513956336904de0acc710;hp=4cbd7d5e704f182c8586d8bb60a5863ce8667397;hpb=fcbb09bb56cab5beaa5fa9ebde0c641b02c9e92b;p=mirror%2Fdsa-puppet.git diff --git a/modules/ganeti2/manifests/init.pp b/modules/ganeti2/manifests/init.pp index 4cbd7d5e7..1708ba857 100644 --- a/modules/ganeti2/manifests/init.pp +++ b/modules/ganeti2/manifests/init.pp @@ -1,94 +1,76 @@ +# = Class: ganeti2 +# +# Standard ganeti2 config debian.org hosts +# +# == Sample Usage: +# +# include ganeti2 +# class ganeti2 { - package { 'ganeti2': - ensure => installed - } + include ganeti2::params + include ganeti2::firewall - package { 'ganeti-instance-debootstrap': - ensure => installed - } + $drbd = $ganeti2::params::drbd - package { 'ganeti-htools': + package { 'ganeti': 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, - } + site::linux_module { 'tun': } - @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, - } - } + file { '/etc/cron.hourly/puppet-cleanup-watcher-pause-file': + source => 'puppet:///modules/ganeti2/cleanup-watcher-pause-file', + mode => '0555', } - file { - '/etc/ganeti/instance-debootstrap/variants.list': - content => template('ganeti2/instance-debootstrap/variants.list.erb'), - ; - '/etc/ganeti/instance-debootstrap/variants/dsa.conf': - content => template('ganeti2/instance-debootstrap/variants/dsa.conf.erb'), - ; - '/etc/ganeti/instance-debootstrap/hooks/00-dsa-configure-networking': - content => template('ganeti2/instance-debootstrap/hooks/00-dsa-configure-networking.erb'), - mode => '0555', - ; - '/etc/ganeti/instance-debootstrap/hooks/10-dsa-install-extra-packages': - content => template('ganeti2/instance-debootstrap/hooks/10-dsa-install-extra-packages.erb'), + if $::debarchitecture == 'arm64' { + file { '/usr/local/bin/qemu-system-aarch64-wrapper': + source => 'puppet:///modules/ganeti2/qemu-system-aarch64-wrapper', mode => '0555', - ; - '/etc/ganeti/instance-debootstrap/hooks/20-dsa-install-bootloader': - content => template('ganeti2/instance-debootstrap/hooks/20-dsa-install-bootloader.erb'), - 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', - ; - '/etc/ganeti/instance-debootstrap/hooks/40-dsa-setup-swapfile': - content => template('ganeti2/instance-debootstrap/hooks/40-dsa-setup-swapfile.erb'), + } + } + if $::cluster == 'ganeti.bm.debian.org' { + file { '/usr/local/sbin/crazy-multipath-restart': + source => 'puppet:///modules/ganeti2/crazy-multipath-restart', mode => '0555', - ; - '/etc/ganeti/instance-debootstrap/hooks/clear-root-password': - mode => '0444', - ; - '/etc/ganeti/instance-debootstrap/hooks/xen-hvc0': - mode => '0444', - ; + } + file { '/etc/cron.d/puppet-crazy-multipath-restart': ensure => absent, } + concat::fragment { 'dsa-puppet-stuff--multipath-restart': + target => '/etc/cron.d/dsa-puppet-stuff', + content => @("EOF"), + */15 * * * * root /usr/local/sbin/crazy-multipath-restart + | EOF + } + } + file { '/usr/local/sbin/ganeti-reboot-cluster': + source => 'puppet:///modules/ganeti2/ganeti-reboot-cluster', + mode => '0555', } + package { ['python-dbus', 'systemd-container']: ensure => installed } + file { '/usr/local/sbin/ganeti-machined-register-instances': + source => 'puppet:///modules/ganeti2/ganeti-machined-register-instances', + mode => '0555', + } + file { [ + '/etc/ganeti/hooks', + '/etc/ganeti/hooks/instance-reboot-post.d', + '/etc/ganeti/hooks/instance-migrate-post.d', + '/etc/ganeti/hooks/instance-start-post.d', + '/etc/ganeti/hooks/instance-failover-post.d', + '/etc/ganeti/hooks/instance-add-post.d', + ]: + ensure => directory, + } + file { [ + '/etc/ganeti/hooks/instance-reboot-post.d/00-ganeti-machined-register-instances', + '/etc/ganeti/hooks/instance-migrate-post.d/00-ganeti-machined-register-instances', + '/etc/ganeti/hooks/instance-start-post.d/00-ganeti-machined-register-instances', + '/etc/ganeti/hooks/instance-failover-post.d/00-ganeti-machined-register-instances', + '/etc/ganeti/hooks/instance-add-post.d/00-ganeti-machined-register-instances', + ]: + ensure => link, + target => '/usr/local/sbin/ganeti-machined-register-instances', + } }