Forge Home

sysctl_conf

Configure Linux kernel parameters at runtime via Hiera configs

5,064 downloads

224 latest version

5.0 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 0.4.0 (latest)
  • 0.3.0
  • 0.2.1
  • 0.2.0
  • 0.1.1
  • 0.1.0
released Jun 22nd 2023
This version is compatible with:
  • Puppet Enterprise 2023.5.x, 2023.4.x, 2023.3.x, 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
  • Puppet >= 6.0.0 < 9.0.0
  • , , , , ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'deric-sysctl_conf', '0.4.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add deric-sysctl_conf
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install deric-sysctl_conf --version 0.4.0

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

deric/sysctl_conf — version 0.4.0 Jun 22nd 2023

Puppet sysctl_conf

Puppet
Forge Test Puppet Forge
Downloads

Configure Linux kernel parameters at runtime via Puppet's Hiera based sysctl.conf management.

Description

By default for each key (e.g. net.ipv4.ip_forward) creates a corresponding configuration file (e.g. /etc/sysctl.d/net.ipv4.ip_forward.conf) with given value (net.ipv4.ip_forward = 1). sysctl configuration is applied immediately.

sysctl_conf::values:
  net.ipv4.ip_forward:
    value: 1

Setup

Either include sysctl_conf directly in your node's definition:

include sysctl_conf

or via Hiera call, e.g.:

lookup('classes', {merge => unique}).include

then make sure to include sysctl_conf in classes definition:

classes:
  - sysctl_conf

Merge behavior

Cofigure merge behavior suitable for you needs:

lookup_options:
  sysctl_conf::values:
    merge: deep

Usage

  • set simple value:
sysctl_conf::values:
  vm.overcommit_memory:
    value: 1
  • ignore non-activated configuration option
sysctl_conf::values:
  "net.ipv6.conf.%{networking.primary}.disable_ipv6":
    value: 1
    silent: true
  • delete entry
sysctl_conf::values:
  kernel.keys.root_maxkeys:
    ensure: absent
  • don't persist configuration on disk
sysctl_conf::values:
  net.ipv6.conf.all.disable_ipv6:
    value: 1
    persist: false
  • add comment
sysctl_conf::values:
  vm.swappiness:
    value: 0
    comment: 'disable swap'
  • don't apply changes with sysctl command (will be applied upon next reboot)
sysctl_conf::values:
  kernel.sem:
    value: '250 32000 256 256'
    apply: false
  • custom configuration file
net.ipv4.ip_forward:
  kernel.sem:
    value: 1
    target: '/etc/sysctl.d/forwarding.conf'

Documentation

Generate documentation:

$ rake strings:generate

in markdown:

$ puppet strings generate --format markdown --out sysctl_conf.md