Move nopat setting to puppetized grub on casulana,mirror-anu,sallinen,storace; and...
[mirror/dsa-puppet.git] / modules / grub / manifests / init.pp
1 class grub {
2         if ($::kernel == 'Linux' and $::is_virtual and $::virtual == 'kvm') {
3                 $grub_manage = true
4                 $grub_do_serial = true
5                 $grub_do_ifnames = true
6         } elsif $::hostname in [ubc-enc2bl01,ubc-enc2bl02,ubc-enc2bl09,ubc-enc2bl10,casulana,mirror-anu,sallinen,storace] {
7                 $grub_manage = true
8                 $grub_do_serial = true
9                 $grub_do_nopat = true
10         } else {
11                 $grub_manage = false
12         }
13
14
15         if $grub_manage {
16                 file { '/etc/default/grub':
17                         # restore to default
18                         source => 'puppet:///modules/grub/etc-default-grub',
19                         notify  => Exec['update-grub']
20                 }
21
22                 file { '/etc/default/grub.d':
23                         ensure => directory
24                 }
25
26                 file { '/etc/default/grub.d/puppet-grub-serial.cfg':
27                         ensure => $grub_do_serial ? { true  => 'present', default => 'absent' },
28                         content  => template('grub/puppet-grub-serial.cfg.erb'),
29                         notify  => Exec['update-grub']
30                 }
31
32                 file { '/etc/default/grub.d/puppet-net-ifnames.cfg':
33                         ensure => $grub_do_ifnames ? { true  => 'present', default => 'absent' },
34                         content  => template('grub/puppet-net-ifnames.cfg.erb'),
35                         notify  => Exec['update-grub']
36                 }
37
38                 file { '/etc/default/grub.d/puppet-kernel-nopat.cfg':
39                         ensure => $grub_do_nopat ? { true  => 'present', default => 'absent' },
40                         content  => template('grub/puppet-kernel-nopat.cfg.erb'),
41                         notify  => Exec['update-grub']
42                 }
43         }
44
45         exec { 'update-grub':
46                 refreshonly => true,
47                 path        => '/usr/bin:/usr/sbin:/bin:/sbin',
48         }
49 }