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

Modify GRUB_CMDLINE_LINUX and GRUB_CMDLINE_LINUX_DEFAULT #23

Open
w3ttr3y opened this issue Aug 23, 2016 · 1 comment
Open

Modify GRUB_CMDLINE_LINUX and GRUB_CMDLINE_LINUX_DEFAULT #23

w3ttr3y opened this issue Aug 23, 2016 · 1 comment

Comments

@w3ttr3y
Copy link

w3ttr3y commented Aug 23, 2016

If I want to clear a setting (e.g. selinux=0), then I can clear it from GRUB_CMDLINE_LINUX or GRUB_CMDLINE_LINUX_DEFAULT but not both:

Clears GRUB_CMDLINE_LINUX but not GRUB_CMDLINE_LINUX_DEFAULT

    kernel_parameter{'selinux':
      ensure   => absent,
      provider => 'grub2',
      bootmode => 'normal',
    } 

Also clears GRUB_CMDLINE_LINUX but not GRUB_CMDLINE_LINUX_DEFAULT

    kernel_parameter{'selinux':
      ensure   => absent,
      provider => 'grub2',
      bootmode => 'all',
    } 

While this will clear GRUB_CMDLINE_LINUX_DEFAULT

kernel_parameter{'selinux-default':
      name     => 'selinux',
      ensure   => absent,
      provider => 'grub2',
      bootmode => 'default'
    }

You can't combine it with either of the above:

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Puppet::Parser::AST::Resource failed with error ArgumentError: Cannot alias Kernel_parameter[selinux-default] to ["selinux"] at test.pp:55; resource ["Kernel_parameter", "selinux"] already declared at test.pp:49 at test.pp:55 on node test.example.com

Thus there doesn't appear to be a way to clear both GRUB_CMDLINE_LINUX and GRUB_CMDLINE_LINUX_DEFAULT

@raphink
Copy link
Member

raphink commented Aug 23, 2016

It seems like what you want is to manage the same kernel parameter in different boot modes.

What is missing for that is to make bootmode a namevar of the type, and set up composite namevar for it.

@kenyon kenyon changed the title Modify GRUB_CMDLINE_LINUX AND GRUB_CMDLINE_LINUX_DEFAULT Modify GRUB_CMDLINE_LINUX and GRUB_CMDLINE_LINUX_DEFAULT Feb 7, 2024
@kenyon kenyon changed the title Modify GRUB_CMDLINE_LINUX and GRUB_CMDLINE_LINUX_DEFAULT Modify GRUB_CMDLINE_LINUX and GRUB_CMDLINE_LINUX_DEFAULT Feb 7, 2024
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

2 participants