Resource Type: grub_menuentry

Defined in:
lib/puppet/type/grub_menuentry.rb
Providers:
grub2

Overview

Manages menu entries in the GRUB and GRUB2 systems.

NOTE: This may not cover all possible options and some options may apply to

either GRUB or GRUB2!

Properties

  • bls

    Explicitly enable, or disable, BLS support for this resource.

    Has on effect on systems that are not BLS enabled.

    Supported values:
    • true
    • false
  • classes

    Add this Array of classes to the menuentry.

  • default_entry

    If set, make this menu entry the default entry.

    If more than one of these is set to ‘true` across all :menuentry resources, this is an error.

    In GRUB2, there is no real guarantee that this will stick since entries further down the line may have custom scripts which alter the default.

    NOTE: You should not use this in conjunction with using the :grub_config

    type to set the system default.
    
    Supported values:
    • true
    • false
  • ensure (defaults to: present)

    The basic property that the resource should be in.

    Supported values:
    • present
    • absent
  • initrd

    The path to the initrd image.

    Set this to ‘:default:’ to copy the default kernel initrd if one exists.

    Set this to ‘:preserve:’ to preserve the current entry. If a current entry does not exist, the default will be copied. If there is no default, this is an error.

    Supported values:
    • %r{^(/.*|:(default|preserve):)}
  • kernel

    The path to the kernel that you wish to boot.

    Set this to ‘:default:’ to copy the default kernel if one exists.

    Set this to ‘:preserve:’ to preserve the current entry. If a current entry does not exist, the default will be copied. If there is no default, this is an error.

    Supported values:
    • %r{^(/.*|:(default|preserve):)}
  • kernel_options (defaults to: :preserve:)

    An array of kernel options to apply to the :kernel property.

    The following format is supported for the new options:
      ':defaults:'  => Copy defaults from the default GRUB entry
      ':preserve:'  => Preserve all existing options (if present)
    
      Note: ':defaults:' and ':preserve:' are mutually exclusive.
    
      All of the options below supersede any items affected by the above
    
      'entry(=.*)?'   => Ensure that `entry` exists *as entered*; replaces all
                         other options with the same name
      '!:entry(=.*)?' => Add this option to the end of the arguments
                         preserving any other options of the same name
      '-:entry'       => Ensure that all instances of `entry` do not exist
      '-:entry=foo'   => Ensure that only instances of `entry` with value `foo` do not exist
    

    Note: Option removals and additions have higher precedence than preservation

  • load_16bit

    If set, ensure that ‘linux16` and `initrd16` are used for the kernel entries.

    Will default to ‘true` unless the entry is a BLS entry.

    Supported values:
    • true
    • false
  • load_video

    If true, add the ‘load_video` command to the menuentry.

    Will default to ‘true` unless the entry is a BLS entry.

    Supported values:
    • true
    • false
  • makeactive (defaults to: false)

    In Legacy GRUB, having this set will add a ‘makeactive’ entry to the menuentry.

    Supported values:
    • true
    • false
  • modules

    An Array of module entry Arrays that apply to the given entry. Since each Multiboot format boot image is unique, you must know what you wish to pass to the module lines.

    The one exception to this is that many of the linux multiboot settings require the kernel and initrd to be passed to them. If you set the ‘:defaults:’ value anywhere in the options array, the default kernel options will be copied to that location in the output.

    The following format is supported for the new options:

    ':defaults:'  => Copy default options from the default *kernel* GRUB entry
    ':preserve:'  => Preserve all existing options (if present)
    
    Note: ':defaults:' and ':preserve:' are mutually exclusive.
    
    All of the options below supersede any items affected by the above
    
      'entry(=.*)?'   => Ensure that `entry` exists *as entered*; replaces all
                       other options with the same name
      '!:entry(=.*)?' => Add this option to the end of the arguments
                       preserving any other options of the same name
      '-:entry'       => Ensure that all instances of `entry` do not exist
      '-:entry=foo'   => Ensure that only instances of `entry` with value `foo` do not exist
    
    Note: Option removals and additions have higher precedence than preservation
    

    Example:

    modules => [
      ['/vmlinuz.1.2.3.4','ro'],
      ['/initrd.1.2.3.4']
    ]
    
  • plugins

    An Array of plugins that should be included in this menuentry.

    Will default to ‘[’gzio’,‘part_msdos’,‘xfs’,‘ext2’]‘ unless the entry is a BLS entry.

  • root

    The filesystem root.

    Supported values:
    • %r{\(.*\)}
  • users (defaults to: [:unrestricted])

    In GRUB2, having this set will add a requirement for the listed users to authenticate to the system in order to utilize the menu entry.

Parameters

  • add_defaults_on_creation (defaults to: true)

    If set, when using the ‘:preserve:’ option in ‘kernel_options` or `modules` will add the system defaults if the entry is being first created. This is the same technique that grub2-mkconfig uses when procesing entries.

    Supported values:
    • true
    • false
    • yes
    • no
  • name (namevar)

    The name of the menu entry.

  • provider

    The specific backend to use for this ‘grub_menuentry` resource. You will seldom need to specify this — Puppet will usually discover the appropriate provider for your platform.

  • target

    The bootloader configuration file, if in a non-default location for the provider.

Features

  • grub

    Can handle Legacy GRUB settings

  • grub2

    Can handle GRUB2 settings