This module manages GRUB 2 bootloader. It does not modify the grub2 configurations files directly but changes the OS specific configuration files (for example /etc/sysconfig/grub on RedHat) and then uses the OS supplied grub2-mkconfig to generate the config files. It will never reboot a system after configuration.
- Red Hat
- Internal. Puppet template to use
- STRING : 'grub2/grub.erb'
- Internal. Used to flatten hiera_array into string
- STRING : Empty by default
- Aditional parameters to add to CMDLINE_LINUX
- ARRAY : Empty by default
- Base parameters to add to CMDLINE_LINUX
- STRING : OS specific
- Number of seconds that the menu will be visible.
- STRING : '5'
hidden_timeout
- Wait this many seconds for the user to press a key. During this period no menu is shown unless the user presses a key. If no key is pressed, control is passed to GRUB _TIMEOUT when the GRUB_HIDDEN_TIMEOUT expires.
- STRING : Empty by default
hidden_timeout_quiet
- Valid settings: true/false. Determines whether a countdown timer is displayed on a blank screen when using the GRUB_HIDDEN_TIMEOUT feature.
- BOOLEAN : Empty by default
- Default boot entry. Setting it to 'saved' enables the "grub2-reboot" and "grub2-set-default" commands to set the default OS for future boots.
- STRING : 'saved'
- Valid settings: true/false. If set to true this setting will automatically set the last selected OS from the menu as the default OS on the next boot.
- BOOLEAN : false
- Sets the background image, enter the full path to the image here.
- STRING : Empty by default
- Set to 'console' to disable graphical terminal.
- STRING : Empty by default
- tbd
- STRING : Empty by default
- Terminal output.
- STRING : console
- Valid settings: true/false.
- BOOLEAN : true
- Valid settings: true/false.
- BOOLEAN : true
- Valid settings: true/false. This entry is used to prevent GRUB from adding the results of os-prober to the menu. A value of "true" disables the os-prober check of other partitions for operating systems, including Windows, Linux, OSX and Hurd, during execution of the update-grub command.
- BOOLEAN : true
class { 'grub2':
cmdline_linux_base => 'rd.lvm.lv=sysvg/lv_swap biosdevname=0 rd.lvm.lv=sysvg/lv_root rhgb quiet',
timeout => '5',
disable_recovery => true,
disable_submenu => true
}
This module also supports the configuration of the parameters it exposes
using Hiera. To set the value of timeout
to 10
, you would use:
grub2::timeout: 10
In adition to this, cmd_linux_extra is an hiera_array where setting can be added at multiple levels in your Hiera files:
Level 1:
grub2::cmdline_linux_extra:
- vga=normal
Level 2:
grub2::cmdline_linux_extra:
- nomodeset
This would end up in 'vga=normal nomodset' being added to CMDLINE_LINUX.