diff options
-rw-r--r-- | lib/puppet/provider/computer/computer.rb | 4 | ||||
-rw-r--r-- | lib/puppet/provider/service/daemontools.rb | 12 | ||||
-rw-r--r-- | lib/puppet/provider/service/launchd.rb | 19 | ||||
-rw-r--r-- | lib/puppet/provider/service/runit.rb | 8 | ||||
-rw-r--r-- | lib/puppet/type/augeas.rb | 8 | ||||
-rwxr-xr-x | lib/puppet/type/file/content.rb | 24 | ||||
-rwxr-xr-x | lib/puppet/type/file/ensure.rb | 28 | ||||
-rw-r--r-- | lib/puppet/type/file/target.rb | 15 | ||||
-rwxr-xr-x | lib/puppet/type/schedule.rb | 40 | ||||
-rwxr-xr-x | lib/puppet/type/zpool.rb | 12 |
10 files changed, 90 insertions, 80 deletions
diff --git a/lib/puppet/provider/computer/computer.rb b/lib/puppet/provider/computer/computer.rb index a6be6bdfe..dd055beb3 100644 --- a/lib/puppet/provider/computer/computer.rb +++ b/lib/puppet/provider/computer/computer.rb @@ -10,9 +10,7 @@ Puppet::Type.type(:computer).provide :directoryservice, :parent => Puppet::Provi domain, not in remote directories. If you wish to manage /etc/hosts on Mac OS X, then simply use the host - type as per other platforms. - - " + type as per other platforms." confine :operatingsystem => :darwin defaultfor :operatingsystem => :darwin diff --git a/lib/puppet/provider/service/daemontools.rb b/lib/puppet/provider/service/daemontools.rb index 65abf7728..bbb962a71 100644 --- a/lib/puppet/provider/service/daemontools.rb +++ b/lib/puppet/provider/service/daemontools.rb @@ -19,10 +19,10 @@ Puppet::Type.type(:service).provide :daemontools, :parent => :base do or this can be overriden in the service resource parameters:: - service { - \"myservice\": - provider => \"daemontools\", path => \"/path/to/daemons\"; - } + service { \"myservice\": + provider => \"daemontools\", + path => \"/path/to/daemons\", + } This provider supports out of the box: @@ -31,10 +31,10 @@ Puppet::Type.type(:service).provide :daemontools, :parent => :base do * restart * status - If a service has ensure => \"running\", it will link /path/to/daemon to + If a service has `ensure => \"running\"`, it will link /path/to/daemon to /path/to/service, which will automatically enable the service. - If a service has ensure => \"stopped\", it will only down the service, not + If a service has `ensure => \"stopped\"`, it will only down the service, not remove the /path/to/service link. " diff --git a/lib/puppet/provider/service/launchd.rb b/lib/puppet/provider/service/launchd.rb index 1632edabf..07c549a8b 100644 --- a/lib/puppet/provider/service/launchd.rb +++ b/lib/puppet/provider/service/launchd.rb @@ -3,33 +3,36 @@ require 'facter/util/plist' Puppet::Type.type(:service).provide :launchd, :parent => :base do desc "launchd service management framework. - This provider manages launchd jobs, the default service framework for - Mac OS X, that has also been open sourced by Apple for possible use on - other platforms. + This provider manages jobs with launchd, which is the default service framework for + Mac OS X and is potentially available for use on other platforms. See: + * http://developer.apple.com/macosx/launchd.html * http://launchd.macosforge.org/ This provider reads plists out of the following directories: + * /System/Library/LaunchDaemons * /System/Library/LaunchAgents * /Library/LaunchDaemons * /Library/LaunchAgents - and builds up a list of services based upon each plists \"Label\" entry. + ...and builds up a list of services based upon each plist's \"Label\" entry. This provider supports: + * ensure => running/stopped, * enable => true/false * status * restart Here is how the Puppet states correspond to launchd states: - * stopped => job unloaded - * started => job loaded - * enabled => 'Disable' removed from job plist file - * disabled => 'Disable' added to job plist file + + * stopped --- job unloaded + * started --- job loaded + * enabled --- 'Disable' removed from job plist file + * disabled --- 'Disable' added to job plist file Note that this allows you to do something launchctl can't do, which is to be in a state of \"stopped/enabled\ or \"running/disabled\". diff --git a/lib/puppet/provider/service/runit.rb b/lib/puppet/provider/service/runit.rb index 0315b9597..736e3db71 100644 --- a/lib/puppet/provider/service/runit.rb +++ b/lib/puppet/provider/service/runit.rb @@ -18,10 +18,10 @@ Puppet::Type.type(:service).provide :runit, :parent => :daemontools do or this can be overriden in the service resource parameters:: - service { - \"myservice\": - provider => \"runit\", path => \"/path/to/daemons\"; - } + service { \"myservice\": + provider => \"runit\", + path => \"/path/to/daemons\", + } This provider supports out of the box: diff --git a/lib/puppet/type/augeas.rb b/lib/puppet/type/augeas.rb index d29bda648..a8fb1f15f 100644 --- a/lib/puppet/type/augeas.rb +++ b/lib/puppet/type/augeas.rb @@ -98,10 +98,10 @@ Puppet::Type.newtype(:augeas) do can be either a string which contains a command or an array of commands. Commands supported are: - set [PATH] [VALUE] Sets the value VALUE at loction PATH - rm [PATH] Removes the node at location PATH - remove [PATH] Synonym for rm - clear [PATH] Keeps the node at PATH, but removes the value. + set [PATH] [VALUE] Sets the value VALUE at loction PATH + rm [PATH] Removes the node at location PATH + remove [PATH] Synonym for rm + clear [PATH] Keeps the node at PATH, but removes the value. ins [LABEL] [WHERE] [PATH] Inserts an empty node LABEL either [WHERE={before|after}] PATH. insert [LABEL] [WHERE] [PATH] Synonym for ins diff --git a/lib/puppet/type/file/content.rb b/lib/puppet/type/file/content.rb index 63c0aaf4d..0e31f3099 100755 --- a/lib/puppet/type/file/content.rb +++ b/lib/puppet/type/file/content.rb @@ -17,19 +17,19 @@ module Puppet desc "Specify the contents of a file as a string. Newlines, tabs, and spaces can be specified using the escaped syntax (e.g., \\n for a newline). The primary purpose of this parameter is to provide a - kind of limited templating:: - - define resolve(nameserver1, nameserver2, domain, search) { - $str = \"search $search - domain $domain - nameserver $nameserver1 - nameserver $nameserver2 - \" - - file { \"/etc/resolv.conf\": - content => $str + kind of limited templating: + + define resolve(nameserver1, nameserver2, domain, search) { + $str = \"search $search + domain $domain + nameserver $nameserver1 + nameserver $nameserver2 + \" + + file { \"/etc/resolv.conf\": + content => $str + } } - } This attribute is especially useful when used with templating." diff --git a/lib/puppet/type/file/ensure.rb b/lib/puppet/type/file/ensure.rb index 4a68551ee..99652ecc6 100755 --- a/lib/puppet/type/file/ensure.rb +++ b/lib/puppet/type/file/ensure.rb @@ -7,29 +7,23 @@ module Puppet if the file is missing will create an empty file. Specifying `absent` will delete the file (and directory if recurse => true). - Anything other than those values will be considered to be a symlink. - For instance, the following text creates a link: + Anything other than those values will create a symlink. In the interest of readability and clarity, you should use `ensure => link` and explicitly specify a + target; however, if a `target` attribute isn't provided, the value of the `ensure` + attribute will be used as the symlink target: - # Useful on solaris + # (Useful on Solaris) + # Less maintainable: file { \"/etc/inetd.conf\": - ensure => \"/etc/inet/inetd.conf\" + ensure => \"/etc/inet/inetd.conf\", } - You can make relative links: - - # Useful on solaris + # More maintainable: file { \"/etc/inetd.conf\": - ensure => \"inet/inetd.conf\" + ensure => link, + target => \"/etc/inet/inetd.conf\", } - - If you need to make a relative link to a file named the same - as one of the valid values, you must prefix it with `./` or - something similar. - - You can also make recursive symlinks, which will create a - directory structure that maps to the target directory, - with directories corresponding to each directory - and links corresponding to each file." + + These two declarations are equivalent." # Most 'ensure' properties have a default, but with files we, um, don't. nodefault diff --git a/lib/puppet/type/file/target.rb b/lib/puppet/type/file/target.rb index b9fe9213b..7d391e672 100644 --- a/lib/puppet/type/file/target.rb +++ b/lib/puppet/type/file/target.rb @@ -1,7 +1,20 @@ module Puppet Puppet::Type.type(:file).newproperty(:target) do desc "The target for creating a link. Currently, symlinks are the - only type supported." + only type supported. + + You can make relative links: + + # (Useful on Solaris) + file { \"/etc/inetd.conf\": + ensure => link, + target => \"inet/inetd.conf\", + } + + You can also make recursive symlinks, which will create a + directory structure that maps to the target directory, + with directories corresponding to each directory + and links corresponding to each file." newvalue(:notlink) do # We do nothing if the value is absent diff --git a/lib/puppet/type/schedule.rb b/lib/puppet/type/schedule.rb index 82f17e533..5fb008f6f 100755 --- a/lib/puppet/type/schedule.rb +++ b/lib/puppet/type/schedule.rb @@ -18,11 +18,11 @@ module Puppet wanted to restrict certain resources to only running once, between the hours of two and 4 AM, then you would use this schedule: - schedule { maint: - range => \"2 - 4\", - period => daily, - repeat => 1 - } + schedule { maint: + range => \"2 - 4\", + period => daily, + repeat => 1 + } With this schedule, the first time that Puppet runs between 2 and 4 AM, all resources with this schedule will get applied, but they won't @@ -35,10 +35,10 @@ module Puppet a schedule named *puppet* is created and used as the default, with the following attributes: - schedule { puppet: - period => hourly, - repeat => 2 - } + schedule { puppet: + period => hourly, + repeat => 2 + } This will cause resources to be applied every 30 minutes by default. " @@ -47,14 +47,14 @@ module Puppet desc "The name of the schedule. This name is used to retrieve the schedule when assigning it to an object: - schedule { daily: - period => daily, - range => \"2 - 4\", - } - - exec { \"/usr/bin/apt-get update\": - schedule => daily - } + schedule { daily: + period => daily, + range => \"2 - 4\", + } + + exec { \"/usr/bin/apt-get update\": + schedule => daily + } " isnamevar @@ -67,9 +67,9 @@ module Puppet seconds can be provided, using the normal colon as a separator. For instance: - schedule { maintenance: - range => \"1:30 - 4:30\" - } + schedule { maintenance: + range => \"1:30 - 4:30\" + } This is mostly useful for restricting certain resources to being applied in maintenance windows or during off-peak hours." diff --git a/lib/puppet/type/zpool.rb b/lib/puppet/type/zpool.rb index df06522e8..40ee8f286 100755 --- a/lib/puppet/type/zpool.rb +++ b/lib/puppet/type/zpool.rb @@ -40,9 +40,10 @@ module Puppet end newproperty(:mirror, :array_matching => :all, :parent => Puppet::Property::MultiVDev) do - desc "List of all the devices to mirror for this pool. Each mirror should be a space separated string: + desc "List of all the devices to mirror for this pool. Each mirror should be a + space separated string: - mirror => [\"disk1 disk2\", \"disk3 disk4\"] + mirror => [\"disk1 disk2\", \"disk3 disk4\"], " @@ -52,9 +53,10 @@ module Puppet end newproperty(:raidz, :array_matching => :all, :parent => Puppet::Property::MultiVDev) do - desc "List of all the devices to raid for this pool. Should be an array of space separated strings: - - raidz => [\"disk1 disk2\", \"disk3 disk4\"] + desc "List of all the devices to raid for this pool. Should be an array of + space separated strings: + + raidz => [\"disk1 disk2\", \"disk3 disk4\"], " |