diff options
Diffstat (limited to 'modules/base_installation/manifests/grub.pp')
-rw-r--r-- | modules/base_installation/manifests/grub.pp | 49 |
1 files changed, 34 insertions, 15 deletions
diff --git a/modules/base_installation/manifests/grub.pp b/modules/base_installation/manifests/grub.pp index 208b745..9ced43f 100644 --- a/modules/base_installation/manifests/grub.pp +++ b/modules/base_installation/manifests/grub.pp | |||
@@ -1,22 +1,41 @@ | |||
1 | class base_installation::grub inherits base_installation { | 1 | class base_installation::grub inherits base_installation { |
2 | ensure_packages(['grub']) | 2 | ensure_packages(['grub']) |
3 | 3 | ||
4 | # unless empty($base_installation::grub_device) { | 4 | if !empty($base_installation::grub_efi_device) { |
5 | # exec { 'install GRUB': | 5 | ensure_packages(['efibootmgr']) |
6 | # command => "/usr/bin/grub-install --target=i386-pc $base_installation::device", | 6 | exec { 'install GRUB UEFI': |
7 | # subscribe => Package["grub"], | 7 | command => "/usr/bin/mkdir /boot/efi && /usr/bin/mount ${base_installation::grub_efi_device} /boot/efi && /usr/bin/grub-install --efi-directory=/boot/efi --target=x86_64-efi && /usr/bin/umount /boot/efi && /usr/bin/rmdir /boot/efi", |
8 | # } | 8 | creates => "/boot/grub/x86_64-efi", |
9 | # } | 9 | subscribe => Package["grub"], |
10 | } | ||
11 | } elsif !empty($base_installation::grub_device) { | ||
12 | exec { 'install GRUB MBR': | ||
13 | command => "/usr/bin/grub-install --target=i386-pc $base_installation::grub_device", | ||
14 | creates => "/boot/grub/i386-pc", | ||
15 | subscribe => Package["grub"], | ||
16 | } | ||
17 | } | ||
10 | 18 | ||
11 | file_line { "/etc/default/grub#GRUB_CMDLINE_LINUX": | 19 | if ($environment == "workstation" and !empty($base_installation::cryptroot_device)) { |
12 | path => "/etc/default/grub", | 20 | file_line { "/etc/default/grub#GRUB_CMDLINE_LINUX": |
13 | line => 'GRUB_CMDLINE_LINUX=" console=tty0 console=ttyS0,115200"', | 21 | path => "/etc/default/grub", |
14 | match => '^GRUB_CMDLINE_LINUX=', | 22 | line => "GRUB_CMDLINE_LINUX=\" cryptdevice=UUID=${base_installation::cryptroot_device}:cryptroot\"", |
15 | require => Package["grub"], | 23 | match => '^GRUB_CMDLINE_LINUX=', |
24 | require => Package["grub"], | ||
25 | notify => Exec["update GRUB config"], | ||
26 | } | ||
27 | } elsif ($environment != "workstation") { | ||
28 | file_line { "/etc/default/grub#GRUB_CMDLINE_LINUX": | ||
29 | path => "/etc/default/grub", | ||
30 | line => 'GRUB_CMDLINE_LINUX=" console=tty0 console=ttyS0,115200"', | ||
31 | match => '^GRUB_CMDLINE_LINUX=', | ||
32 | require => Package["grub"], | ||
33 | notify => Exec["update GRUB config"], | ||
34 | } | ||
16 | } | 35 | } |
17 | 36 | ||
18 | # exec { 'update GRUB config': | 37 | exec { 'update GRUB config': |
19 | # command => "/usr/bin/grub-mkconfig -o /boot/grub/grub.cfg", | 38 | command => "/usr/bin/grub-mkconfig -o /boot/grub/grub.cfg", |
20 | # refreshonly => true | 39 | refreshonly => true |
21 | # } | 40 | } |
22 | } | 41 | } |