Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate GRUB_CMDLINE entries if no kernel_parameter bootmode is specified #71

Open
jamesps-ebi opened this issue Aug 16, 2022 · 0 comments

Comments

@jamesps-ebi
Copy link

jamesps-ebi commented Aug 16, 2022

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet-Server: 6.26.0
  • Puppet-Agent: 6.28.0
  • Distribution: Ubuntu 20.04.4
  • Module version: 3.2.0

How to reproduce (e.g Puppet code you use)

Using a puppet lookup with either 'deep', or 'hash' merge type (as below)

class profile::hiera::kernel_parameters {
  # Lookup for kernel_parameter resources
  lookup( 'kernel_parameters', Hash[String, Any], 'deep', {} ).each |String $name, Any $options| {
    # Set kernel_parameter resources
    ensure_resource( 'kernel_parameter', $name, $options )
  }
}

Specifying a kernel parameter in hiera without a specific 'bootmode' given, and also specifying some other kernel parameters elsewhere in the hiera hierarchy.

global.yaml - lowest priority

# Configure kernel parameters at boottime
kernel_parameters:
# disable ipv6 by default on every machine
  ipv6.disable:
    ensure: present
    value: '1'

node.yaml - highest priority

kernel_parameters:
  # quiet splash
  quiet:
    ensure: present
    bootmode: default
  splash:
    ensure: present
    bootmode: default

What are you seeing

The above can result in the kernel parameter (ipv6.disable) being duplicated between the GRUB_CMDLINE_LINUX_DEFAULT and GRUB_CMDLINE_LINUX sections of /etc/default/grub file, similar to #38

# grep CMDLINE /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1 quiet splash"
GRUB_CMDLINE_LINUX="ipv6.disable=1"

What behaviour did you expect instead

Kernel parameters should only appear in one of either GRUB_CMDLINE_LINUX_DEFAULT or GRUB_CMDLINE_LINUX, but not both.

Explicitly specifying a bootmode will cause the kernel parameter to only appear in one of the two GRUB_CMDLINE* sections as expected.

Output log

Any additional information you'd like to impart

@kenyon kenyon changed the title Duplicate GRUB_CMDLINE entries if no kernel_parameter 'bootmode' is specified Duplicate GRUB_CMDLINE entries if no kernel_parameter bootmode is specified Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant