This is a simple native type which allows you to manage the sysctl configuration file from within Puppet. Note that this version does not actually manage the live sysctl settings, it only manages the entries in the configuration file. By default the file managed is /etc/sysctl.conf.
Here's a sample manifest fragment that will set the value of kernel.sysrq to 1:
sysctl { "kernel.sysrq":
val => "1"
}
If you would like any changes to be reflected in real time, the simplest way is to set up an Exec entry that reloads the config file.
exec { load-sysctl:
command => "/sbin/sysctl -p /etc/sysctl.conf",
refreshonly => true
}
And to set reloading as the default for any sysctl instances:
Sysctl {
notify => Exec[load-sysctl]
}