Puppet Class: sysctl::initrd

Defined in:
manifests/initrd.pp

Summary

Rebuild initrd after all sysctl rules applied

Overview

Puppet types an providers are currently unable to batch operations. Easiest way to make sure the initrd is only updated once is therefore to put something in the catalogue and refer to it which leads to this workaround. Make sure to include this class to satisfy the redhat requirement to rebuild the initrd when sysctl settings change.

Parameters:

  • rebuild_initrd_cmd (String) (defaults to: "/usr/sbin/dracut -v -f")

    Command to run to rebuild initrd

  • enabled (Boolean) (defaults to: true)

    Set ‘false` to disable the initrd rebuild

See Also:



12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'manifests/initrd.pp', line 12

class sysctl::initrd(
  String  $rebuild_initrd_cmd = "/usr/sbin/dracut -v -f",
  Boolean $enabled            = true,
) {

  if $enabled {
    exec { "sysctl_rebuild_initrd":
      command     => $rebuild_initrd_cmd,
      refreshonly => true,
    }

    Sysctl <||> ~> Exec["sysctl_rebuild_initrd"]
  }
}