1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
Puppet::Type.newtype(:sysctl) do
@doc = "Manages kernel parameters in /etc/sysctl.conf. By default this will
only edit the configuration file, and not change any of the runtime
values. If you wish changes to be activated right away, you can do
so with an exec like so:
exec { load-sysctl:
command => \"/sbin/sysctl -p /etc/sysctl.conf\",
refreshonly => true
}
Set any changes you want to happen right away to notify this command,
or you can set it as the default:
Sysctl {
notify => Exec[load-sysctl]
}"
ensurable
newparam(:name, :namevar => true) do
desc "Name of the parameter"
isnamevar
end
newproperty(:val) do
desc "Value the parameter should be set to"
end
newproperty(:target) do
desc "Name of the file to store parameters in"
defaultto { if @resource.class.defaultprovider and
@resource.class.defaultprovider.ancestors.include?(Puppet::Provider::ParsedFile)
@resource.class.defaultprovider.default_target
else
nil
end
}
end
end
|