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