From 6f6c4b5f55d00df370f7d00a2499551e36aa880b Mon Sep 17 00:00:00 2001 From: nfagerlund Date: Mon, 28 Feb 2011 09:55:19 -0800 Subject: (#6509) Inline docs: Fix broken code block in file type (content attribute) --- lib/puppet/type/file/content.rb | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) 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." -- cgit From f4034f76892b25b4a2e162f9229f2871c0a9d37c Mon Sep 17 00:00:00 2001 From: nfagerlund Date: Mon, 28 Feb 2011 09:58:58 -0800 Subject: (#6509) Inline docs: fix broken code blocks in schedule.rb. --- lib/puppet/type/schedule.rb | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) 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." -- cgit From 27863c3ab6d54bfa5d647770f35ef7ce10e1ac20 Mon Sep 17 00:00:00 2001 From: nfagerlund Date: Mon, 28 Feb 2011 10:21:03 -0800 Subject: (#6509) Inline docs: Fix code blocks in service type. --- lib/puppet/provider/service/daemontools.rb | 12 ++++++------ lib/puppet/provider/service/runit.rb | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) 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/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: -- cgit From c80a77d0d141cd933db3f4b124b992d767577f08 Mon Sep 17 00:00:00 2001 From: nfagerlund Date: Mon, 28 Feb 2011 10:30:19 -0800 Subject: (#6509) Inline docs: Fix broken code blocks in zpool type This one was subtle. If the first paragraph of a Markdown string embedded in a type isn't multiple lines, a code block immediately following it will not be recognized. So, hard-wrap or die, I guess. --- lib/puppet/type/zpool.rb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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\"], " -- cgit From 94f8ead4efbd5909f1bb4f7e62cb5d705d55d381 Mon Sep 17 00:00:00 2001 From: nfagerlund Date: Mon, 28 Feb 2011 10:37:46 -0800 Subject: (#6509) Inline docs: Fix broken lists in Launchd provider. Lists need a leading linebreak. --- lib/puppet/provider/service/launchd.rb | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) 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\". -- cgit From ea9f1f05934403b8d70e903efbb941ce74961b86 Mon Sep 17 00:00:00 2001 From: nfagerlund Date: Mon, 28 Feb 2011 10:58:53 -0800 Subject: Maint: Rewrite comments about symlinks to reflect best practice. Don't use ensure => 'path/to/file', because it's hard to read. Use ensure => link and specify a target =>. --- lib/puppet/type/file/ensure.rb | 28 +++++++++++----------------- lib/puppet/type/file/target.rb | 15 ++++++++++++++- 2 files changed, 25 insertions(+), 18 deletions(-) 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 -- cgit From 65a5496754fcdf938bda96a42b83255a310d193b Mon Sep 17 00:00:00 2001 From: nfagerlund Date: Mon, 28 Feb 2011 11:05:37 -0800 Subject: (#6509) Inline docs: Fix erroneous code block in directoryservice provider for computer type --- lib/puppet/provider/computer/computer.rb | 4 +--- 1 file changed, 1 insertion(+), 3 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 -- cgit From e2a50858aa05b63a6573ed534f18942cea47e44d Mon Sep 17 00:00:00 2001 From: nfagerlund Date: Mon, 28 Feb 2011 11:09:15 -0800 Subject: Maint: Align tabs in a code block in the Augeas type. --- lib/puppet/type/augeas.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 -- cgit