X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fgrub%2Fmanifests%2Finit.pp;h=c4db78f48559be206e4f0cf3a353eae98f83f06b;hb=ace665bc01241d6062543f11e2072762119d4e57;hp=1ef9ec783cfc68e2d9ba47d2a3c96a3528034512;hpb=a640453031f7f590851d8e0f27fb3de39be2801a;p=mirror%2Fdsa-puppet.git diff --git a/modules/grub/manifests/init.pp b/modules/grub/manifests/init.pp index 1ef9ec783..c4db78f48 100644 --- a/modules/grub/manifests/init.pp +++ b/modules/grub/manifests/init.pp @@ -1,25 +1,78 @@ class grub { if ($::kernel == 'Linux' and $::is_virtual and $::virtual == 'kvm') { + $grub_manage = true + $grub_do_kernel_serial = true + $grub_do_grub_serial = true + $grub_do_ifnames = true + } elsif $::hostname in [ubc-enc2bl01,ubc-enc2bl02,ubc-enc2bl09,ubc-enc2bl10,casulana,mirror-anu,sallinen,storace,mirror-accumu] { + $grub_manage = true + $grub_do_kernel_serial = true + $grub_do_grub_serial = true + $grub_do_nopat = true + } elsif $::hostname in [mirror-skroutz,aagaard,acker,arm-arm-01,fasolo] { + $grub_manage = true + $grub_do_kernel_serial = true + $grub_do_grub_serial = true + $grub_do_nopat = false + } elsif $::hostname in [acker,arm-arm-03] { + $grub_manage = true + $grub_do_kernel_serial = true + $grub_do_grub_serial = false + $grub_do_nopat = false + } else { + $grub_manage = false + } + + if $::hostname in [fasolo] { + $grub_do_extra = true + } else { + $grub_do_extra = false + } + + if $grub_manage { file { '/etc/default/grub': # restore to default source => 'puppet:///modules/grub/etc-default-grub', notify => Exec['update-grub'] } + file { '/etc/default/grub.d': ensure => directory } + file { '/etc/default/grub.d/puppet-grub-serial.cfg': + ensure => $grub_do_kernel_serial ? { true => 'present', default => 'absent' }, content => template('grub/puppet-grub-serial.cfg.erb'), notify => Exec['update-grub'] } + + file { '/etc/default/grub.d/puppet-kernel-serial.cfg': + ensure => $grub_do_grub_serial ? { true => 'present', default => 'absent' }, + content => template('grub/puppet-kernel-serial.cfg.erb'), + notify => Exec['update-grub'] + } + file { '/etc/default/grub.d/puppet-net-ifnames.cfg': + ensure => $grub_do_ifnames ? { true => 'present', default => 'absent' }, content => template('grub/puppet-net-ifnames.cfg.erb'), notify => Exec['update-grub'] } - exec { 'update-grub': - refreshonly => true, - path => '/usr/bin:/usr/sbin:/bin:/sbin', + file { '/etc/default/grub.d/puppet-kernel-nopat.cfg': + ensure => $grub_do_nopat ? { true => 'present', default => 'absent' }, + content => template('grub/puppet-kernel-nopat.cfg.erb'), + notify => Exec['update-grub'] + } + + file { '/etc/default/grub.d/puppet-kernel-extra.cfg': + ensure => $grub_do_extra ? { true => 'present', default => 'absent' }, + content => template('grub/puppet-kernel-extra.cfg.erb'), + notify => Exec['update-grub'] } } + + exec { 'update-grub': + refreshonly => true, + path => '/usr/bin:/usr/sbin:/bin:/sbin', + } }