X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fganeti2%2Fmanifests%2Finit.pp;h=20236b1e4e7c0f1f6497cb34f71d03c01bf02891;hb=3e5945324a388a3b0b4ac6bff81a88c30bba0fcf;hp=3605b583e9cb82b5598d87493cfaa37ed871ca2c;hpb=83f14aaf89b77bb64cac65f9c455062bd3fc4c74;p=mirror%2Fdsa-puppet.git diff --git a/modules/ganeti2/manifests/init.pp b/modules/ganeti2/manifests/init.pp index 3605b583e..20236b1e4 100644 --- a/modules/ganeti2/manifests/init.pp +++ b/modules/ganeti2/manifests/init.pp @@ -1,30 +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 { 'drbd8-utils': - ensure => installed - } + $drbd = $ganeti2::params::drbd - package { 'ganeti-instance-debootstrap': + package { 'ganeti': ensure => installed } - package { 'ganeti-htools': - ensure => installed + base::linux_module { 'tun': } + + file { '/etc/cron.hourly/puppet-cleanup-watcher-pause-file': + source => 'puppet:///modules/ganeti2/cleanup-watcher-pause-file', + mode => '0555', } - @ferm::rule { 'dsa-ganeti-v4': - description => 'Allow ganeti from ganeti master', - rule => 'proto tcp mod state state (NEW) dport (1811) @subchain \'ganeti\' { saddr ($HOST_GANETI_V4) ACCEPT; }', - notarule => true, + if $::debarchitecture == 'arm64' { + file { '/usr/local/bin/qemu-system-aarch64-wrapper': + source => 'puppet:///modules/ganeti2/qemu-system-aarch64-wrapper', + mode => '0555', + } + } + if $::cluster == 'ganeti.bm.debian.org' { + file { '/usr/local/sbin/crazy-multipath-restart': + source => 'puppet:///modules/ganeti2/crazy-multipath-restart', + mode => '0555', + } + file { '/etc/cron.d/puppet-crazy-multipath-restart': ensure => absent, } + concat::fragment { 'puppet-crontab--multipath-restart': + target => '/etc/cron.d/puppet-crontab', + 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', } - @ferm::rule { 'dsa-drbd-v4': - description => 'Allow ganeti from ganeti master', - rule => 'proto tcp mod state state (NEW) dport (11000:11999) @subchain \'drbd\' { saddr ($HOST_DRBD_V4) daddr ($HOST_DRBD_V4) ACCEPT; }', - notarule => true, + 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', } }