Skip to content

Latest commit

 

History

History
424 lines (245 loc) · 11.8 KB

REFERENCE.md

File metadata and controls

424 lines (245 loc) · 11.8 KB

Reference

Table of Contents

Resource types

  • grub_config: Manages global GRUB configuration parameters
  • grub_menuentry: 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_user: Manages GRUB2 Users - Does not apply to GRUB Legacy Note: This type compares against the active GRUB configuration. The contents of the ma
  • kernel_parameter: Manages kernel parameters stored in bootloaders.

Resource types

grub_config

Manages global GRUB configuration parameters

Properties

The following properties are available in the grub_config type.

ensure

Valid values: present, absent

The basic property that the resource should be in.

Default value: present

value

Value of the GRUB parameter.

Parameters

The following parameters are available in the grub_config type.

name

namevar

The parameter that you wish to set.

GRUB < 2

In the case of GRUB < 2, this will be something like 'default', 'timeout', etc...

See info grub for additional information.

GRUB >= 2

With GRUB >= 2, this will be 'GRUB_DEFAULT', 'GRUB_SAVEDEFAULT', etc..

See info grub2 for additional information.

provider

The specific backend to use for this grub_config 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.

grub_menuentry

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

The following properties are available in the grub_menuentry type.

bls

Valid values: true, false

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

Has on effect on systems that are not BLS enabled.

classes

Add this Array of classes to the menuentry.

default_entry

Valid values: true, false

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.

ensure

Valid values: present, absent

The basic property that the resource should be in.

Default value: present

initrd

Valid values: %r{^(/.*|:(default|preserve):)}

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.

kernel

Valid values: %r{^(/.*|:(default|preserve):)}

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.

kernel_options

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

Default value: :preserve:

load_16bit

Valid values: true, false

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

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

load_video

Valid values: true, false

If true, add the load_video command to the menuentry.

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

makeactive

Valid values: true, false

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

Default value: 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

Valid values: %r{\(.*\)}

The filesystem root.

users

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.

Default value: [:unrestricted]

Parameters

The following parameters are available in the grub_menuentry type.

add_defaults_on_creation

Valid values: true, false, yes, no

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.

Default value: true

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.

grub_user

Manages GRUB2 Users - Does not apply to GRUB Legacy

Note: This type compares against the active GRUB configuration. The contents of the management file will not be updated unless the active configuration is out of sync with the expected configuration.

Properties

The following properties are available in the grub_user type.

ensure

Valid values: present, absent

The basic property that the resource should be in.

Default value: present

password

The user's password. If the password is not already in a GRUB2 compatible form, it will be automatically converted.

purge

Valid values: true, false

Purge all unmanaged users.

This does not affect any users that are not defined by Puppet! There is no way to reliably eliminate the items from all other scripts without potentially severely damaging the GRUB2 build scripts.

Default value: false

Parameters

The following parameters are available in the grub_user type.

name

namevar

The username of the GRUB2 user to be managed.

provider

The specific backend to use for this grub_user resource. You will seldom need to specify this --- Puppet will usually discover the appropriate provider for your platform.

report_unmanaged

Valid values: true, false

Report any unmanaged users as a warning during the Puppet run.

Default value: false

rounds

Valid values: %r{^\d+$}

The rounds to use when hashing the password.

Default value: 10_000

superuser

Valid values: true, false

If set, add this user to the 'superusers' list, if no superusers are set, but grub_user resources have been declared, a compile error will be raised.

Default value: false

target

The file to which to write the user information.

Must be an absolute path.

Default value: /etc/grub.d/02_puppet_managed_users

kernel_parameter

Manages kernel parameters stored in bootloaders.

Properties

The following properties are available in the kernel_parameter type.

ensure

Valid values: present, absent

The basic property that the resource should be in.

Default value: present

value

Value of the parameter if applicable. Many parameters are just keywords so this must be left blank, while others (e.g. 'vga') will take a value.

Parameters

The following parameters are available in the kernel_parameter type.

bootmode

Valid values: all, default, normal, recovery

Boot mode(s) to apply the parameter to. Either 'all' (default) to use the parameter on all boots (normal and recovery mode), 'default' for just the default boot entry, 'normal' for just normal boots or 'recovery' for just recovery boots.

Default value: all

name

namevar

The parameter name, e.g. 'quiet' or 'vga'.

provider

The specific backend to use for this kernel_parameter 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.