Skip to content

Commit 55556e2

Browse files
authored
Merge pull request puppetlabs#9422 from joshcooper/doc_updates
(PUP-12063) Merge osp-docs changes back to puppet
2 parents fc698a2 + 709438c commit 55556e2

18 files changed

+100
-83
lines changed

lib/puppet/application/apply.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ def help
153153
154154
EXAMPLE
155155
-------
156+
$ puppet apply -e 'notify { "hello world": }'
156157
$ puppet apply -l /tmp/manifest.log manifest.pp
157158
$ puppet apply --modulepath=/root/dev/modules -e "include ntpd::server"
158159
$ puppet apply --catalog catalog.json

lib/puppet/application/ssl.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ def help
5757
* submit_request:
5858
Generate a certificate signing request (CSR) and submit it to the CA. If
5959
a private and public key pair already exist, they will be used to generate
60-
the CSR. Otherwise a new key pair will be generated. If a CSR has already
60+
the CSR. Otherwise, a new key pair will be generated. If a CSR has already
6161
been submitted with the given `certname`, then the operation will fail.
6262
6363
* generate_request:
64-
Generate a certificate signing request (CSR). If
65-
a private and public key pair already exist, they will be used to generate
66-
the CSR. Otherwise a new key pair will be generated.
64+
Generate a certificate signing request (CSR). If a private and public key
65+
pair exist, they will be used to generate the CSR. Otherwise a new key
66+
pair will be generated.
6767
6868
* download_cert:
6969
Download a certificate for this host. If the current private key matches

lib/puppet/defaults.rb

Lines changed: 60 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ def self.default_diffargs
77
'-u'
88
end
99

10+
# If you modify this, update puppet/type/file/checksum.rb too
1011
def self.default_digest_algorithm
1112
'sha256'
1213
end
@@ -161,8 +162,8 @@ def self.initialize_default_settings!(settings)
161162
:skip_logging_catalog_request_destination => {
162163
:default => false,
163164
:type => :boolean,
164-
:desc => "If you wish to suppress the notice of which compiler supplied the
165-
catalog",
165+
:desc => "Specifies whether to suppress the notice of which compiler
166+
supplied the catalog. A value of `true` suppresses the notice.",
166167
},
167168
:merge_dependency_warnings => {
168169
:default => false,
@@ -417,13 +418,15 @@ def self.initialize_default_settings!(settings)
417418
:type => :boolean,
418419
:default => true,
419420
:desc => <<-'EOT'
420-
When versioned_environment_dirs is `true` Puppet will readlink the environmentpath
421-
when constructing the environment's modulepath. The full readlinked path is referred
422-
to as the "resolved path" and the configured path potentially containing symlinks is
423-
the "configured path". When reporting where resources come from users may choose
424-
between the configured or resolved path.
425-
426-
When set to false, the resolved paths are reported instead of the configured paths.
421+
Specifies how environment paths are reported. When the value of
422+
`versioned_environment_dirs` is `true`, Puppet applies the readlink function to
423+
the `environmentpath` setting when constructing the environment's modulepath. The
424+
full readlinked path is referred to as the "resolved path," and the configured
425+
path potentially containing symlinks is the "configured path." When reporting
426+
where resources come from, users may choose between the configured and resolved
427+
path.
428+
429+
When set to `false`, the resolved paths are reported instead of the configured paths.
427430
EOT
428431
},
429432
:use_last_environment => {
@@ -1204,33 +1207,34 @@ def self.initialize_default_settings!(settings)
12041207
:ca_refresh_interval => {
12051208
:default => "1d",
12061209
:type => :duration,
1207-
:desc => "How often the Puppet agent refreshes its local CA certs. By
1208-
default the CA certs are refreshed once every 24 hours. If a different
1209-
duration is specified, then the agent will refresh its CA certs whenever
1210-
it next runs and the elapsed time since the certs were last refreshed
1211-
exceeds the duration.
1212-
1213-
In general, the duration should be greater than the `runinterval`.
1214-
Setting it to 0 or an equal or lesser value than `runinterval`,
1215-
will cause the CA certs to be refreshed on every run.
1216-
1217-
If the agent downloads new CA certs, the agent will use it for subsequent
1210+
:desc => "How often the Puppet agent refreshes its local CA
1211+
certificates. By default, CA certificates are refreshed every 24 hours. If a
1212+
different interval is specified, the agent refreshes its CA certificates during
1213+
the next agent run if the elapsed time since the certificates were last
1214+
refreshed exceeds the specified duration.
1215+
1216+
In general, the interval should be greater than the `runinterval`
1217+
value. Setting the `ca_refresh_interval` value to 0 or an equal or
1218+
lesser value than `runinterval` causes the CA certificates to be
1219+
refreshed on every run.
1220+
1221+
If the agent downloads new CA certs, the agent uses those for subsequent
12181222
network requests. If the refresh request fails or if the CA certs are
12191223
unchanged on the server, then the agent run will continue using the
12201224
local CA certs it already has. #{AS_DURATION}",
12211225
},
12221226
:crl_refresh_interval => {
12231227
:default => "1d",
12241228
:type => :duration,
1225-
:desc => "How often the Puppet agent refreshes its local CRL. By
1226-
default the CRL is refreshed once every 24 hours. If a different
1227-
duration is specified, then the agent will refresh its CRL whenever
1228-
it next runs and the elapsed time since the CRL was last refreshed
1229-
exceeds the duration.
1229+
:desc => "How often the Puppet agent refreshes its local Certificate
1230+
Revocation List (CRL). By default, the CRL is refreshed every 24 hours. If
1231+
a different interval is specified, the agent refreshes its CRL on the next
1232+
Puppet agent run if the elapsed time since the CRL was last refreshed
1233+
exceeds the specified interval.
12301234
1231-
In general, the duration should be greater than the `runinterval`.
1232-
Setting it to 0 or an equal or lesser value than `runinterval`,
1233-
will cause the CRL to be refreshed on every run.
1235+
In general, the interval should be greater than the `runinterval` value.
1236+
Setting the `crl_refresh_interval` value to 0 or an equal or lesser value
1237+
than `runinterval` causes the CRL to be refreshed on every run.
12341238
12351239
If the agent downloads a new CRL, the agent will use it for subsequent
12361240
network requests. If the refresh request fails or if the CRL is
@@ -1240,18 +1244,19 @@ def self.initialize_default_settings!(settings)
12401244
:hostcert_renewal_interval => {
12411245
:default => "30d",
12421246
:type => :duration,
1243-
:desc => "When the Puppet agent refreshes its client certificate.
1244-
By default the client certificate will refresh 30 days before the certificate
1245-
expires. If a different duration is specified, then the agent will refresh its
1246-
client certificate whenever it next runs and if the client certificate expires
1247-
within the duration specified.
1247+
:desc => "How often the Puppet agent renews its client certificate. By
1248+
default, the client certificate is renewed 30 days before the certificate
1249+
expires. If a different interval is specified, the agent renews its client
1250+
certificate during the next agent run, assuming that the client certificate has
1251+
expired within the specified duration.
12481252
1249-
In general, the duration should be greater than the `runinterval`.
1250-
Setting it to 0 will disable automatic renewal.
1253+
In general, the `hostcert_renewal_interval` value should be greater than the
1254+
`runinterval` value. Setting the `hostcert_renewal_interval` value to 0 disables
1255+
automatic renewal.
12511256
1252-
If the agent downloads a new certificate, the agent will use it for subsequent
1253-
network requests. If the refresh request fails, then the agent run will continue using the
1254-
certificate it already has. #{AS_DURATION}",
1257+
If the agent downloads a new certificate, the agent will use it
1258+
for subsequent network requests. If the refresh request fails, the agent run
1259+
continues to use its existing certificate. #{AS_DURATION}",
12551260
},
12561261
:keylength => {
12571262
:default => 4096,
@@ -1492,8 +1497,10 @@ def self.initialize_default_settings!(settings)
14921497
:exclude_unchanged_resources => {
14931498
:default => true,
14941499
:type => :boolean,
1495-
:desc => 'When set to true, resources that have had no changes after catalog application
1496-
will not have corresponding unchanged resource status updates listed in the report.'
1500+
:desc => "Specifies how unchanged resources are listed in reports. When
1501+
set to `true`, resources that have had no changes after catalog application
1502+
will not have corresponding unchanged resource status updates listed in a
1503+
report."
14971504
},
14981505
:reportdir => {
14991506
:default => "$vardir/reports",
@@ -1745,11 +1752,12 @@ def self.initialize_default_settings!(settings)
17451752
:allow_pson_serialization => {
17461753
:default => false,
17471754
:type => :boolean,
1748-
:desc => "Whether when unable to serialize to JSON or other formats,
1749-
Puppet falls back to PSON. This option affects both puppetserver's
1750-
configuration management service responses and when the agent saves its
1751-
cached catalog. This option is useful in preventing the loss of data because
1752-
rich data cannot be serialized via PSON.",
1755+
:desc => "Whether to allow PSON serialization. When unable to serialize to
1756+
JSON or other formats, Puppet falls back to PSON. This option affects the
1757+
configuration management service responses of Puppet Server and the process by
1758+
which the agent saves its cached catalog. With a default value of `false`, this
1759+
option is useful in preventing the loss of data because rich data cannot be
1760+
serialized via PSON.",
17531761
},
17541762
:agent_catalog_run_lockfile => {
17551763
:default => "$statedir/agent_catalog_run.lock",
@@ -1775,7 +1783,7 @@ def self.initialize_default_settings!(settings)
17751783
:type => :boolean,
17761784
:default => false,
17771785
:desc => "Whether to include legacy facts when requesting a catalog. This
1778-
option can be set to false provided all puppet manifests, hiera.yaml and hiera
1786+
option can be set to `false` if all puppet manifests, hiera.yaml, and hiera
17791787
configuration layers no longer access legacy facts, such as `$osfamily`, and
17801788
instead access structured facts, such as `$facts['os']['family']`."
17811789
},
@@ -2091,12 +2099,12 @@ def self.initialize_default_settings!(settings)
20912099
:preprocess_deferred => {
20922100
:default => false,
20932101
:type => :boolean,
2094-
:desc => "Whether puppet should call deferred functions before applying
2095-
the catalog. If set to `true`, then all prerequisites needed for the
2096-
deferred function must be satisfied prior to puppet running. If set to
2097-
`false`, then deferred functions will follow puppet relationships and
2098-
ordering. This allows puppet to install prerequisites needed for a
2099-
deferred function and call the deferred function in the same run."
2102+
:desc => "Whether Puppet should call deferred functions before applying
2103+
the catalog. If set to `true`, all prerequisites required for the
2104+
deferred function must be satisfied before the Puppet run. If set to
2105+
`false`, deferred functions follow Puppet relationships and
2106+
ordering. In this way, Puppet can install the prerequisites required for a
2107+
deferred function and call the deferred function in the same run.",
21002108
},
21012109
:summarize => {
21022110
:default => false,

lib/puppet/functions/capitalize.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# This function is compatible with the stdlib function with the same name.
66
#
77
# The function does the following:
8-
# * For a `String`, a string with its first character in upper case version is returned.
8+
# * For a `String`, a string is returned in which the first character is uppercase.
99
# This is done using Ruby system locale which handles some, but not all
1010
# special international up-casing rules (for example German double-s ß is capitalized to "Ss").
1111
# * For an `Iterable[Variant[String, Numeric]]` (for example an `Array`) each value is capitalized and the conversion is not recursive.

lib/puppet/functions/find_file.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
# directory. (For example, the reference `mysql/mysqltuner.pl` will search for the
88
# file `<MODULES DIRECTORY>/mysql/files/mysqltuner.pl`.)
99
#
10+
# If this function is run via puppet agent, it checks for file existence on the
11+
# Puppet Primary server. If run via puppet apply, it checks on the local host.
12+
# In both cases, the check is performed before any resources are changed.
13+
#
1014
# This function can also accept:
1115
#
1216
# * An absolute String path, which checks for the existence of a file from anywhere on disk.

lib/puppet/functions/index.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
# Note that the lambda gets the value and not an array with `[key, value]` as in other
4141
# iterative functions.
4242
#
43-
# Using a lambda that accepts two values works the same way, it simply gets the index/key
44-
# as the first parameter, and the value as the second.
43+
# Using a lambda that accepts two values works the same way. The lambda gets the index/key
44+
# as the first parameter and the value as the second parameter.
4545
#
4646
# @example Using the `index` function with an Array and a two-parameter lambda
4747
#

lib/puppet/functions/lookup.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
# or `{'strategy' => 'hash'}` --- Same as the string versions of these merge behaviors.
9898
# * `{'strategy' => 'deep', <DEEP OPTION> => <VALUE>, ...}` --- Same as `'deep'`,
9999
# but can adjust the merge with additional options. The available options are:
100-
# * `'knockout_prefix'` (string or undef) --- A string prefix to indicate a
100+
# * `'knockout_prefix'` (string) --- A string prefix to indicate a
101101
# value should be _removed_ from the final result. If a value is exactly equal
102102
# to the prefix, it will knockout the entire element. Defaults to `undef`, which
103103
# disables this feature.

lib/puppet/functions/new.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@
557557
# @example Simple Conversion to String specifying the format for the given value directly
558558
#
559559
# ```puppet
560-
# $str = String(10, "%#x") # produces '0x10'
560+
# $str = String(10, "%#x") # produces '0xa'
561561
# $str = String([10], "%(a") # produces '("10")'
562562
# ```
563563
#

lib/puppet/functions/regsubst.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# - *M* Multiline regexps
2121
# - *G* Global replacement; all occurrences of the regexp in each target string will be replaced. Without this, only the first occurrence will be replaced.
2222
# @param encoding [Enum['N','E','S','U']]
23-
# Deprecated and ignored parameter, only here for compatibility.
23+
# Deprecated and ignored parameter, included only for compatibility.
2424
# @return [Array[String], String] The result of the substitution. Result type is the same as for the target parameter.
2525
# @deprecated
2626
# This method has the optional encoding parameter, which is ignored.

lib/puppet/functions/unique.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,9 @@
6565
# *first-found* unique value, but for `Hash` it contains associations from a set of keys to the set of values clustered by the
6666
# equality lambda (or the default value equality if no lambda was given). This makes the `unique` function more versatile for hashes
6767
# in general, while requiring that the simple computation of "hash's unique set of values" is performed as `$hsh.map |$k, $v| { $v }.unique`.
68-
# (A unique set of hash keys is in general meaningless (since they are unique by definition) - although if processed with a different
69-
# lambda for equality that would be different. First map the hash to an array of its keys if such a unique computation is wanted).
68+
# (Generally, it's meaningless to compute the unique set of hash keys because they are unique by definition. However, the
69+
# situation can change if the hash keys are processed with a different lambda for equality. For this unique computation,
70+
# first map the hash to an array of its keys.)
7071
# If the more advanced clustering is wanted for one of the other data types, simply transform it into a `Hash` as shown in the
7172
# following example.
7273
#

lib/puppet/type/exec.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -437,13 +437,12 @@ def check(value)
437437
actually contain `myfile`, the exec will keep running every time
438438
Puppet runs.
439439
440-
This parameter can also take an array of files and the command will
441-
not run if **any** of these files exist. For example:
440+
This parameter can also take an array of files, and the command will
441+
not run if **any** of these files exist. Consider this example:
442442
443443
creates => ['/tmp/file1', '/tmp/file2'],
444444
445-
will only run the command if both files don't exist.
446-
445+
The command is only run if both files don't exist.
447446
EOT
448447

449448
accept_arrays

lib/puppet/type/file/checksum.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@
77
Puppet::Type.type(:file).newparam(:checksum) do
88
include Puppet::Util::Checksums
99

10+
# The default is defined in Puppet.default_digest_algorithm
1011
desc "The checksum type to use when determining whether to replace a file's contents.
1112
12-
The default checksum type is #{Puppet.default_digest_algorithm}."
13+
The default checksum type is sha256."
1314

14-
newvalues(*Puppet::Util::Checksums.known_checksum_types)
15+
# The values are defined in Puppet::Util::Checksums.known_checksum_types
16+
newvalues(:sha256, :sha256lite, :md5, :md5lite, :sha1, :sha1lite, :sha512, :sha384, :sha224, :mtime, :ctime, :none)
1517

1618
defaultto do
1719
Puppet[:digest_algorithm].to_sym

lib/puppet/type/file/ctime.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
module Puppet
44
Puppet::Type.type(:file).newproperty(:ctime) do
5-
desc %q(A read-only state to check the file ctime. On most modern \*nix-like
5+
desc "A read-only state to check the file ctime. On most modern \*nix-like
66
systems, this is the time of the most recent change to the owner, group,
7-
permissions, or content of the file.)
7+
permissions, or content of the file."
88

99
def retrieve
1010
current_value = :absent

lib/puppet/type/file/mtime.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
module Puppet
44
Puppet::Type.type(:file).newproperty(:mtime) do
5-
desc %q(A read-only state to check the file mtime. On \*nix-like systems, this
6-
is the time of the most recent change to the content of the file.)
5+
desc "A read-only state to check the file mtime. On \*nix-like systems, this
6+
is the time of the most recent change to the content of the file."
77

88
def retrieve
99
current_value = :absent

0 commit comments

Comments
 (0)