Default variable details
Some of debops.grub default variables have more extensive configuration
than simple strings or lists, here you can find documentation and examples for
them.
grub__configuration
The grub__*_configuration variables define the contents of the
/etc/default/grub.d/ansible.cfg configuration file. The variables are
lists of YAML dictionaries, the dictionaries with the same name parameter
are merged together in an order specified by the
grub__combined_configuration variable, which allows some of the
configuration to be modified via Ansible inventory or other Ansible roles.
Examples
Configure unattended filesystem check and repair on boot:
grub__configuration:
- name: 'cmdline_linux_default'
value:
- 'fsck.mode=force'
Remove the quiet parameter from the default kernel command line:
grub__configuration:
- name: 'cmdline_linux_default'
value:
- name: 'quiet'
state: 'absent'
Syntax
Each variable contains a list of YAML dictionaries, each dictionary defines a configuration file option using specific parameters:
nameRequired. Name of a GRUB option, it's also used as an anchor for merging multiple configuration entries together.
The option name should be specified as lowercase, without the
GRUB_prefix. For example:GRUB_DEFAULT -> 'default' GRUB_CMDLINE_LINUX -> 'cmdline_linux'
You can specify the full names with uppercase, but they will not be automatically merged with existing configuration.
valueThe value which should be set for a given GRUB option. Values can be YAML booleans, numbers, strings or lists of strings. Additionally, in a list you can specify values in an extended format as a YAML dictionary with parameters:
nameThe value you want to manage, a string.
stateIf not specified or
present, the value will be included in the configuration. Ifabsent, the value will be removed from the configuration. Ifignore, a given entry will not be evaluated by the role.
The
valueparameters that contain YAML lists from multiple configuration entries are merged together.stateOptional. Specify the state of a given configuration entry. If not specified or
present, the entry will be set in the GRUB configuration file. Ifabsent, the entry will be removed from the configuration file. Ifignore, this configuration entry will not be evaluated by the role.commentOptional. String or a YAML text block with a comment added to a given configuration option in the GRUB config file.
quoteOptional, boolean. If not specified or
True, the value will be quoted. IfFalse, the value will not be quoted.originalOptional, boolean. If
True, the role will add$GRUB_<NAME>string to the given configuration option, based on the entry name. This allows to preserve existing GRUB options from the/etc/default/grub; this is useful only for specific options like kernel parameters.exportOptional, boolean. if
True, the option will be exported in the GRUB environment by adding theexportprefix in the configuration file. This is only needed in specific configuration scenarios.