install virt-what and use facter's default virtual facts
[mirror/dsa-puppet.git] / modules / grub / manifests / init.pp
1 class grub {
2         if ($::kernel == 'Linux' and $::is_virtual and $::virtual == 'kvm') {
3                 file { '/etc/default/grub':
4                         # restore to default
5                         source => 'puppet:///modules/grub/etc-default-grub',
6                         notify  => Exec['update-grub']
7                 }
8                 file { '/etc/default/grub.d':
9                         ensure => directory
10                 }
11                 file { '/etc/default/grub.d/puppet-grub-serial.cfg':
12                         content  => template('grub/puppet-grub-serial.cfg.erb'),
13                         notify  => Exec['update-grub']
14                 }
15                 file { '/etc/default/grub.d/puppet-net-ifnames.cfg':
16                         content  => template('grub/puppet-net-ifnames.cfg.erb'),
17                         notify  => Exec['update-grub']
18                 }
19
20                 exec { 'update-grub':
21                         refreshonly => true,
22                         path        => '/usr/bin:/usr/sbin:/bin:/sbin',
23                 }
24         }
25 }