X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fgrub%2Fmanifests%2Finit.pp;h=2c0ee0049c30886171c9fdaaca7d6d690513f21e;hb=0e95fbdd080c4c7156bf2c4f938c0b85629a3981;hp=05d6f1f233f2fcaa445a506d26b0a6170acbf90e;hpb=ef087f2fe05308f8d399c790762a7745f2c63a09;p=mirror%2Fdsa-puppet.git diff --git a/modules/grub/manifests/init.pp b/modules/grub/manifests/init.pp index 05d6f1f23..2c0ee0049 100644 --- a/modules/grub/manifests/init.pp +++ b/modules/grub/manifests/init.pp @@ -1,22 +1,36 @@ class grub { + $grub_do_ifnames = ($::kernel == 'Linux' and $::is_virtual and $::virtual == 'kvm') + if ($::kernel == 'Linux' and $::is_virtual and $::virtual == 'kvm') { $grub_manage = true - $grub_do_serial = true - $grub_do_ifnames = true - } elsif $::hostname in [ubc-enc2bl01,ubc-enc2bl02,ubc-enc2bl09,ubc-enc2bl10,casulana,mirror-anu,sallinen,storace,mirror-skroutz] { + $grub_do_kernel_serial = true + $grub_do_grub_serial = true + } elsif $::hostname in [ubc-enc2bl01,ubc-enc2bl02,ubc-enc2bl09,ubc-enc2bl10,casulana,mirror-anu,sallinen,storace,mirror-accumu,bm-bl1,bm-bl2,bm-bl3,bm-bl4,bm-bl5,bm-bl6,bm-bl7,bm-bl8,bm-bl9,bm-bl10,bm-bl11,bm-bl12,bm-bl13,bm-bl14] { + $grub_manage = true + $grub_do_kernel_serial = true + $grub_do_grub_serial = true + } elsif $::hostname in [mirror-skroutz,aagaard,conova-node02,arm-arm-01,fasolo] { + $grub_manage = true + $grub_do_kernel_serial = true + $grub_do_grub_serial = true + } elsif $::hostname in [arm-arm-03] { $grub_manage = true - $grub_do_serial = true - $grub_do_nopat = true - } elsif $::hostname in [mirror-accumu] { + $grub_do_kernel_serial = true + $grub_do_grub_serial = false + } elsif $::hostname in [villa,mirror-isc] { $grub_manage = true - $grub_do_serial = true - $grub_do_nopat = true + $grub_do_kernel_serial = false + $grub_do_grub_serial = false } else { $grub_manage = false } - if $grub_manage { + # hp-health requires nopat on linux 4.9 + $grub_do_nopat = ($::systemproductname and $::systemproductname =~ /^ProLiant/ and versioncmp($::kernelversion, '4.9') >= 0) + + $grub_do_extra = $::hostname in [fasolo] + file { '/etc/default/grub': # restore to default source => 'puppet:///modules/grub/etc-default-grub', @@ -24,15 +38,26 @@ class grub { } file { '/etc/default/grub.d': - ensure => directory + ensure => directory, + mode => '0555', + purge => true, + force => true, + recurse => true, + source => 'puppet:///files/empty/', } file { '/etc/default/grub.d/puppet-grub-serial.cfg': - ensure => $grub_do_serial ? { true => 'present', default => 'absent' }, + 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'), @@ -44,6 +69,12 @@ class grub { 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':