Skip to content

Persisting a sysctl that does not exist yet #49

@zenitraM

Description

@zenitraM

Hi! 👋 I want to persist a sysctl that does not exist on the running system.
This is because I want it to be enabled on next reboot before a kernel upgrade, so it gets enabled at boot before a subsequent Puppet run.

This would be something that, reading the docs, I thought would be doable using:

sysctl { "non_existing_sysctl":
  ensure  => present,
  value   => "1",
  apply   => false,
  persist => true,
}

However, if the sysctl does not exist, it currently fails (as it checks for its presence from the list obtained by sysctl -a), and if the :silent=>true parameter is set, it just adds the comment, not the actual value.

Would this be a behavior that would make sense adding to the module?. I see there is some support implemented for non-existent sysctls already for absent but not for present.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions