Version information
This version is compatible with:
- Puppet Enterprise 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x, 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x
- Puppet >= 5.0.0 < 8.0.0
- , , ,
Start using this module
Add this module to your Puppetfile:
mod 'atsonkov-grubby', '0.3.2'
Learn more about managing modules with a PuppetfileDocumentation
puppet-module-grubby
Table of Contents
- Description
- Setup - The basics of getting started with grubby
- Usage - Configuration options and additional functionality
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
Description
The Grubby Puppet module allows for managing the GRUB configuration using Grubby
Setup
What grubby affects
This module can be used to manage the boot loader configuration like setting default kernel, add or remove kernel arguments.
It modifies mostly the files under /boot.
Beginning with grubby
include ::grubby
Usage
Examples are provided in the REFERENCE.md
Reference
Please check REFERENCE.md
Limitations
This module should work with all platforms that can use grubby for managing their configuration, but is primary developed for and tested on RHEL 8.
Development
Please use Puppet Development kit (pdk)
Validate syntax
pdk validate
Run unit tests
pdk test unit
For details on how to add code comments and generate documentation with Strings, see the Puppet Strings documentation and style guide
Preparation for release: Please check CONTRIBUTING.md
Reference
Table of Contents
Classes
grubby
: Manage bootloader configuration via grubbygrubby::config
: Applies desired configuration via grubby
Defined types
grubby::kernel_opt
: Applies kernel parameter configuration via grubby
Data types
Grubby::Kernel_Opts
: Parameters for each kernel argument
Classes
grubby
Manage bootloader configuration via grubby
Examples
Include Class
include ::grubby
Specify Default Kernel
class{'grubby:
default_kernel => 'vmlinuz-4.18.0-240.15.1.el8_3.x86_64',
}
Add and Remove Kernel Options
class{'grubby':
kernel_opts => {
audit => {
ensure => present,
value => 1,
scope => 'DEFAULT',
},
audit_backlog_limit => {
value => 1,
},
selinux => {
'ensure' => 'absent',
'scope' => 'ALL',
}
}
}
Parameters
The following parameters are available in the grubby
class:
default_kernel
Data type: Optional[String[1]]
The kernel version to set as default in the bootloader.
Default value: undef
kernel_opts
Data type: Optional[Hash[Pattern[/^\S+$/], Grubby::Kernel_Opts]]
The kernel options that should be managed for the default kernel If ensure is not specified, present will be used (the other option being absent) If scope is not specified, DEFAULT will be used (valid options are also ALL or specific kernel) Example: audit: ensure: present value: 1 scope: DEFAULT audit_backlog_limit: value: 8192 selinux: ensure: absent scope: ALL enforcing: ensure: absent
Default value: {}
grubby::config
This is a private class, that performs the necessary changes via grubby
Defined types
grubby::kernel_opt
Applies kernel parameter configuration via grubby
Examples
Add Single Parameter
grubby::kernel_opt{'keyword':}
Delete a Single Parameter
grubby::kernel_opt{'selinix':
ensure => 'absent',
}
Add Parameter with Value
grubby::kernel_opt{'memsize':
value => '22',
}
Parameters
The following parameters are available in the grubby::kernel_opt
defined type:
opt
Data type: Pattern[/^\S+$/]
Kernel option
Default value: $name
ensure
Data type: Enum['present', 'absent']
add or delete kernel option
Default value: 'present'
value
Data type: Optional[Variant[Pattern[/^\S+$/],Integer]]
Value of kernel option
Default value: undef
scope
Data type: Variant[Enum['DEFAULT','ALL'],Pattern[/^TITLE=.+$/]]
Which kernels to apply parameters to
Default value: 'DEFAULT'
Data types
Grubby::Kernel_Opts
Parameters for each kernel argument
Alias of
Struct[{
Optional['ensure'] => Enum['present','absent'],
Optional['value'] => Variant[Pattern[/^\S+$/],Integer],
Optional['scope'] => Variant[Enum['DEFAULT','ALL'],Pattern[/^TITLE=.+$/]],
}]
Change log
All notable changes to this project will be documented in this file. The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
v0.3.2 (2022-04-29)
Fixed
v0.3.1 (2022-04-29)
Added
v0.3.0 (2021-03-26)
Added
- Values of kernel parameters cannot contain spacesNospacevalue #12 (traylenator)
- Restrict kernel parameters to not contain spaces #10 (traylenator)
- Create new type grubby::kernel_opt #8 (traylenator)
- Stronger typing of kernel options #6 (traylenator)
Fixed
- Fix alignment in docs #13 (traylenator)
- Avoid test "grubby command" == "grubby command" #9 (traylenator)
- Add examples of using parameters #7 (traylenator)
v0.2.2 (2020-06-05)
v0.2.1 (2020-04-02)
v0.2.0 (2020-04-02)
v0.1.2 (2020-03-18)
Added
v0.1.1 (2020-03-18)
* This Changelog was automatically generated by github_changelog_generator
Copyright (C) 2020 Atanas Tsonkov <atanas.tsonkov@gmail.com> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.