bolt 0.17.1 → 0.17.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of bolt might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/bolt-modules/boltlib/lib/puppet/functions/run_task.rb +25 -13
- data/lib/bolt/cli.rb +45 -15
- data/lib/bolt/config.rb +48 -132
- data/lib/bolt/executor.rb +3 -10
- data/lib/bolt/inventory.rb +15 -1
- data/lib/bolt/puppetdb.rb +11 -0
- data/lib/bolt/puppetdb/client.rb +68 -0
- data/lib/bolt/puppetdb/config.rb +76 -0
- data/lib/bolt/target.rb +5 -4
- data/lib/bolt/transport/base.rb +11 -2
- data/lib/bolt/transport/local.rb +11 -5
- data/lib/bolt/transport/orch.rb +16 -5
- data/lib/bolt/transport/ssh.rb +32 -1
- data/lib/bolt/transport/ssh/connection.rb +17 -10
- data/lib/bolt/transport/winrm.rb +18 -1
- data/lib/bolt/transport/winrm/connection.rb +15 -16
- data/lib/bolt/util.rb +15 -0
- data/lib/bolt/version.rb +1 -1
- data/lib/bolt_ext/puppetdb_inventory.rb +5 -135
- data/vendored/facter/lib/facter/ec2/rest.rb +1 -1
- data/vendored/hiera/lib/hiera/version.rb +1 -1
- data/vendored/puppet/lib/puppet/application/agent.rb +1 -3
- data/vendored/puppet/lib/puppet/application/apply.rb +2 -4
- data/vendored/puppet/lib/puppet/application/cert.rb +6 -1
- data/vendored/puppet/lib/puppet/application/device.rb +100 -13
- data/vendored/puppet/lib/puppet/application/facts.rb +5 -0
- data/vendored/puppet/lib/puppet/application/lookup.rb +11 -1
- data/vendored/puppet/lib/puppet/configurer.rb +17 -4
- data/vendored/puppet/lib/puppet/configurer/plugin_handler.rb +1 -1
- data/vendored/puppet/lib/puppet/datatypes.rb +1 -1
- data/vendored/puppet/lib/puppet/defaults.rb +1 -1
- data/vendored/puppet/lib/puppet/environments.rb +2 -2
- data/vendored/puppet/lib/puppet/error.rb +6 -3
- data/vendored/puppet/lib/puppet/external/dot.rb +0 -7
- data/vendored/puppet/lib/puppet/external/nagios/parser.rb +1 -1
- data/vendored/puppet/lib/puppet/face/config.rb +41 -8
- data/vendored/puppet/lib/puppet/face/epp.rb +30 -5
- data/vendored/puppet/lib/puppet/face/facts.rb +49 -0
- data/vendored/puppet/lib/puppet/face/help.rb +33 -35
- data/vendored/puppet/lib/puppet/face/man.rb +55 -12
- data/vendored/puppet/lib/puppet/face/parser.rb +30 -3
- data/vendored/puppet/lib/puppet/file_bucket/file.rb +0 -2
- data/vendored/puppet/lib/puppet/file_serving/base.rb +10 -10
- data/vendored/puppet/lib/puppet/functions.rb +1 -3
- data/vendored/puppet/lib/puppet/functions/alert.rb +1 -1
- data/vendored/puppet/lib/puppet/functions/all.rb +6 -6
- data/vendored/puppet/lib/puppet/functions/annotate.rb +10 -10
- data/vendored/puppet/lib/puppet/functions/any.rb +6 -6
- data/vendored/puppet/lib/puppet/functions/assert_type.rb +4 -4
- data/vendored/puppet/lib/puppet/functions/binary_file.rb +14 -2
- data/vendored/puppet/lib/puppet/functions/break.rb +31 -2
- data/vendored/puppet/lib/puppet/functions/call.rb +4 -4
- data/vendored/puppet/lib/puppet/functions/contain.rb +19 -3
- data/vendored/puppet/lib/puppet/functions/convert_to.rb +6 -5
- data/vendored/puppet/lib/puppet/functions/crit.rb +1 -1
- data/vendored/puppet/lib/puppet/functions/debug.rb +1 -1
- data/vendored/puppet/lib/puppet/functions/defined.rb +11 -9
- data/vendored/puppet/lib/puppet/functions/dig.rb +26 -2
- data/vendored/puppet/lib/puppet/functions/each.rb +8 -8
- data/vendored/puppet/lib/puppet/functions/emerg.rb +1 -1
- data/vendored/puppet/lib/puppet/functions/empty.rb +79 -0
- data/vendored/puppet/lib/puppet/functions/err.rb +1 -1
- data/vendored/puppet/lib/puppet/functions/filter.rb +7 -7
- data/vendored/puppet/lib/puppet/functions/find_file.rb +15 -1
- data/vendored/puppet/lib/puppet/functions/flatten.rb +64 -0
- data/vendored/puppet/lib/puppet/functions/hiera.rb +6 -6
- data/vendored/puppet/lib/puppet/functions/hiera_array.rb +6 -6
- data/vendored/puppet/lib/puppet/functions/hiera_hash.rb +6 -6
- data/vendored/puppet/lib/puppet/functions/hiera_include.rb +8 -8
- data/vendored/puppet/lib/puppet/functions/include.rb +28 -2
- data/vendored/puppet/lib/puppet/functions/info.rb +1 -1
- data/vendored/puppet/lib/puppet/functions/inline_epp.rb +2 -2
- data/vendored/puppet/lib/puppet/functions/join.rb +56 -0
- data/vendored/puppet/lib/puppet/functions/keys.rb +25 -0
- data/vendored/puppet/lib/puppet/functions/length.rb +44 -0
- data/vendored/puppet/lib/puppet/functions/lest.rb +39 -1
- data/vendored/puppet/lib/puppet/functions/map.rb +10 -9
- data/vendored/puppet/lib/puppet/functions/match.rb +6 -6
- data/vendored/puppet/lib/puppet/functions/new.rb +995 -2
- data/vendored/puppet/lib/puppet/functions/next.rb +1 -1
- data/vendored/puppet/lib/puppet/functions/notice.rb +1 -1
- data/vendored/puppet/lib/puppet/functions/reduce.rb +6 -6
- data/vendored/puppet/lib/puppet/functions/regsubst.rb +9 -3
- data/vendored/puppet/lib/puppet/functions/require.rb +36 -2
- data/vendored/puppet/lib/puppet/functions/return.rb +1 -1
- data/vendored/puppet/lib/puppet/functions/reverse_each.rb +71 -2
- data/vendored/puppet/lib/puppet/functions/slice.rb +23 -9
- data/vendored/puppet/lib/puppet/functions/split.rb +12 -10
- data/vendored/puppet/lib/puppet/functions/step.rb +73 -1
- data/vendored/puppet/lib/puppet/functions/strftime.rb +176 -2
- data/vendored/puppet/lib/puppet/functions/then.rb +65 -2
- data/vendored/puppet/lib/puppet/functions/tree_each.rb +19 -19
- data/vendored/puppet/lib/puppet/functions/type.rb +42 -1
- data/vendored/puppet/lib/puppet/functions/unique.rb +13 -13
- data/vendored/puppet/lib/puppet/functions/unwrap.rb +8 -4
- data/vendored/puppet/lib/puppet/functions/values.rb +25 -0
- data/vendored/puppet/lib/puppet/functions/versioncmp.rb +1 -1
- data/vendored/puppet/lib/puppet/functions/warning.rb +1 -1
- data/vendored/puppet/lib/puppet/functions/with.rb +6 -4
- data/vendored/puppet/lib/puppet/indirector/certificate_status/file.rb +1 -1
- data/vendored/puppet/lib/puppet/indirector/facts/facter.rb +1 -3
- data/vendored/puppet/lib/puppet/indirector/facts/rest.rb +21 -0
- data/vendored/puppet/lib/puppet/indirector/facts/yaml.rb +0 -4
- data/vendored/puppet/lib/puppet/indirector/file_content/http.rb +3 -1
- data/vendored/puppet/lib/puppet/indirector/indirection.rb +5 -3
- data/vendored/puppet/lib/puppet/indirector/request.rb +6 -2
- data/vendored/puppet/lib/puppet/module/task.rb +2 -2
- data/vendored/puppet/lib/puppet/module_tool/tar/mini.rb +57 -4
- data/vendored/puppet/lib/puppet/network/authconfig.rb +1 -1
- data/vendored/puppet/lib/puppet/network/http/api/indirected_routes.rb +1 -0
- data/vendored/puppet/lib/puppet/network/resolver.rb +1 -2
- data/vendored/puppet/lib/puppet/node.rb +4 -3
- data/vendored/puppet/lib/puppet/parser/compiler.rb +12 -5
- data/vendored/puppet/lib/puppet/parser/compiler/catalog_validator/env_relationship_validator.rb +1 -1
- data/vendored/puppet/lib/puppet/parser/functions/fqdn_rand.rb +15 -4
- data/vendored/puppet/lib/puppet/parser/functions/new.rb +31 -46
- data/vendored/puppet/lib/puppet/parser/parser_factory.rb +1 -1
- data/vendored/puppet/lib/puppet/parser/resource.rb +1 -1
- data/vendored/puppet/lib/puppet/parser/type_loader.rb +11 -11
- data/vendored/puppet/lib/puppet/pops/evaluator/closure.rb +1 -1
- data/vendored/puppet/lib/puppet/pops/evaluator/collector_transformer.rb +1 -1
- data/vendored/puppet/lib/puppet/pops/evaluator/epp_evaluator.rb +2 -2
- data/vendored/puppet/lib/puppet/pops/evaluator/runtime3_resource_support.rb +2 -2
- data/vendored/puppet/lib/puppet/pops/evaluator/runtime3_support.rb +5 -2
- data/vendored/puppet/lib/puppet/pops/functions/dispatch.rb +1 -1
- data/vendored/puppet/lib/puppet/pops/issue_reporter.rb +18 -1
- data/vendored/puppet/lib/puppet/pops/issues.rb +6 -3
- data/vendored/puppet/lib/puppet/pops/loader/ruby_data_type_instantiator.rb +1 -2
- data/vendored/puppet/lib/puppet/pops/loader/ruby_function_instantiator.rb +1 -2
- data/vendored/puppet/lib/puppet/pops/loader/task_instantiator.rb +4 -4
- data/vendored/puppet/lib/puppet/pops/loader/type_definition_instantiator.rb +4 -1
- data/vendored/puppet/lib/puppet/pops/loaders.rb +18 -7
- data/vendored/puppet/lib/puppet/pops/lookup/global_data_provider.rb +1 -1
- data/vendored/puppet/lib/puppet/pops/model/factory.rb +6 -3
- data/vendored/puppet/lib/puppet/pops/model/model_tree_dumper.rb +4 -0
- data/vendored/puppet/lib/puppet/pops/model/pn_transformer.rb +400 -0
- data/vendored/puppet/lib/puppet/pops/parser/eparser.rb +1 -1
- data/vendored/puppet/lib/puppet/pops/parser/heredoc_support.rb +1 -1
- data/vendored/puppet/lib/puppet/pops/parser/lexer_support.rb +3 -2
- data/vendored/puppet/lib/puppet/pops/parser/locator.rb +0 -2
- data/vendored/puppet/lib/puppet/pops/parser/pn_parser.rb +316 -0
- data/vendored/puppet/lib/puppet/pops/pcore.rb +17 -17
- data/vendored/puppet/lib/puppet/pops/pn.rb +236 -0
- data/vendored/puppet/lib/puppet/pops/resource/resource_type_impl.rb +1 -1
- data/vendored/puppet/lib/puppet/pops/types/class_loader.rb +6 -3
- data/vendored/puppet/lib/puppet/pops/types/implementation_registry.rb +28 -35
- data/vendored/puppet/lib/puppet/pops/types/p_object_type.rb +3 -3
- data/vendored/puppet/lib/puppet/pops/types/p_timespan_type.rb +2 -2
- data/vendored/puppet/lib/puppet/pops/types/p_type_set_type.rb +24 -1
- data/vendored/puppet/lib/puppet/pops/types/ruby_generator.rb +3 -4
- data/vendored/puppet/lib/puppet/pops/types/type_calculator.rb +1 -1
- data/vendored/puppet/lib/puppet/pops/types/type_factory.rb +0 -4
- data/vendored/puppet/lib/puppet/pops/types/type_mismatch_describer.rb +1 -1
- data/vendored/puppet/lib/puppet/pops/types/type_parser.rb +14 -7
- data/vendored/puppet/lib/puppet/pops/types/types.rb +1 -1
- data/vendored/puppet/lib/puppet/pops/utils.rb +2 -2
- data/vendored/puppet/lib/puppet/pops/validation/checker4_0.rb +6 -2
- data/vendored/puppet/lib/puppet/provider/group/groupadd.rb +3 -1
- data/vendored/puppet/lib/puppet/provider/group/windows_adsi.rb +4 -7
- data/vendored/puppet/lib/puppet/provider/nameservice.rb +3 -3
- data/vendored/puppet/lib/puppet/provider/package/dnf.rb +1 -1
- data/vendored/puppet/lib/puppet/provider/package/gem.rb +1 -1
- data/vendored/puppet/lib/puppet/provider/package/pacman.rb +4 -4
- data/vendored/puppet/lib/puppet/provider/package/pip.rb +3 -3
- data/vendored/puppet/lib/puppet/provider/package/pkgdmg.rb +3 -3
- data/vendored/puppet/lib/puppet/provider/package/pkgutil.rb +2 -2
- data/vendored/puppet/lib/puppet/provider/package/portage.rb +9 -9
- data/vendored/puppet/lib/puppet/provider/package/zypper.rb +2 -2
- data/vendored/puppet/lib/puppet/provider/service/base.rb +1 -1
- data/vendored/puppet/lib/puppet/provider/service/smf.rb +3 -2
- data/vendored/puppet/lib/puppet/provider/user/useradd.rb +6 -2
- data/vendored/puppet/lib/puppet/provider/user/windows_adsi.rb +1 -1
- data/vendored/puppet/lib/puppet/provider/zfs/zfs.rb +3 -2
- data/vendored/puppet/lib/puppet/reference/configuration.rb +2 -0
- data/vendored/puppet/lib/puppet/reference/type.rb +11 -11
- data/vendored/puppet/lib/puppet/resource.rb +1 -1
- data/vendored/puppet/lib/puppet/resource/capability_finder.rb +2 -2
- data/vendored/puppet/lib/puppet/resource/catalog.rb +2 -2
- data/vendored/puppet/lib/puppet/resource/status.rb +9 -2
- data/vendored/puppet/lib/puppet/resource/type.rb +1 -1
- data/vendored/puppet/lib/puppet/settings.rb +31 -19
- data/vendored/puppet/lib/puppet/settings/base_setting.rb +5 -0
- data/vendored/puppet/lib/puppet/settings/config_file.rb +1 -1
- data/vendored/puppet/lib/puppet/settings/ttl_setting.rb +5 -0
- data/vendored/puppet/lib/puppet/ssl/certificate_factory.rb +2 -2
- data/vendored/puppet/lib/puppet/ssl/certificate_request.rb +0 -2
- data/vendored/puppet/lib/puppet/transaction/additional_resource_generator.rb +2 -2
- data/vendored/puppet/lib/puppet/transaction/event.rb +1 -1
- data/vendored/puppet/lib/puppet/transaction/report.rb +1 -1
- data/vendored/puppet/lib/puppet/type.rb +9 -13
- data/vendored/puppet/lib/puppet/type/augeas.rb +2 -2
- data/vendored/puppet/lib/puppet/type/cron.rb +11 -6
- data/vendored/puppet/lib/puppet/type/exec.rb +1 -1
- data/vendored/puppet/lib/puppet/type/file.rb +4 -5
- data/vendored/puppet/lib/puppet/type/host.rb +1 -1
- data/vendored/puppet/lib/puppet/type/k5login.rb +30 -54
- data/vendored/puppet/lib/puppet/type/package.rb +3 -3
- data/vendored/puppet/lib/puppet/type/schedule.rb +12 -12
- data/vendored/puppet/lib/puppet/type/scheduled_task.rb +2 -2
- data/vendored/puppet/lib/puppet/type/ssh_authorized_key.rb +5 -5
- data/vendored/puppet/lib/puppet/type/sshkey.rb +2 -2
- data/vendored/puppet/lib/puppet/type/tidy.rb +9 -2
- data/vendored/puppet/lib/puppet/type/user.rb +1 -1
- data/vendored/puppet/lib/puppet/type/yumrepo.rb +25 -4
- data/vendored/puppet/lib/puppet/type/zfs.rb +4 -0
- data/vendored/puppet/lib/puppet/util.rb +0 -4
- data/vendored/puppet/lib/puppet/util/backups.rb +1 -1
- data/vendored/puppet/lib/puppet/util/http_proxy.rb +4 -2
- data/vendored/puppet/lib/puppet/util/inifile.rb +3 -4
- data/vendored/puppet/lib/puppet/util/log.rb +2 -5
- data/vendored/puppet/lib/puppet/util/network_device/cisco/facts.rb +1 -1
- data/vendored/puppet/lib/puppet/util/reference.rb +1 -8
- data/vendored/puppet/lib/puppet/util/tagging.rb +1 -1
- data/vendored/puppet/lib/puppet/util/warnings.rb +0 -2
- data/vendored/puppet/lib/puppet/util/windows/adsi.rb +15 -18
- data/vendored/puppet/lib/puppet/util/windows/com.rb +2 -1
- data/vendored/puppet/lib/puppet/util/windows/file.rb +2 -2
- data/vendored/puppet/lib/puppet/util/windows/principal.rb +7 -6
- data/vendored/puppet/lib/puppet/util/windows/sid.rb +60 -7
- data/vendored/puppet/lib/puppet/util/windows/taskscheduler.rb +0 -9
- data/vendored/puppet/lib/puppet/version.rb +1 -1
- data/vendored/puppet/lib/puppet_pal.rb +53 -48
- metadata +15 -2
@@ -9,8 +9,8 @@ require 'puppet/parameter/boolean'
|
|
9
9
|
module Puppet
|
10
10
|
Type.newtype(:package) do
|
11
11
|
@doc = "Manage packages. There is a basic dichotomy in package
|
12
|
-
support right now: Some package types (
|
13
|
-
retrieve their own package files, while others (
|
12
|
+
support right now: Some package types (such as yum and apt) can
|
13
|
+
retrieve their own package files, while others (such as rpm and sun)
|
14
14
|
cannot. For those package formats that cannot retrieve their own files,
|
15
15
|
you can use the `source` parameter to point to the correct file.
|
16
16
|
|
@@ -242,7 +242,7 @@ module Puppet
|
|
242
242
|
name => $ssl,
|
243
243
|
}
|
244
244
|
|
245
|
-
|
245
|
+
...
|
246
246
|
|
247
247
|
$ssh = $operatingsystem ? {
|
248
248
|
solaris => SMCossh,
|
@@ -18,8 +18,8 @@ module Puppet
|
|
18
18
|
time within that schedule, then the resources will get applied;
|
19
19
|
otherwise, that work may never get done.
|
20
20
|
|
21
|
-
Thus, it is advisable to use wider scheduling (
|
22
|
-
hours) combined with periods and repetitions. For instance, if you
|
21
|
+
Thus, it is advisable to use wider scheduling (for example, over a couple
|
22
|
+
of hours) combined with periods and repetitions. For instance, if you
|
23
23
|
wanted to restrict certain resources to only running once, between
|
24
24
|
the hours of two and 4 AM, then you would use this schedule:
|
25
25
|
|
@@ -36,7 +36,7 @@ module Puppet
|
|
36
36
|
because they will be outside the scheduled range.
|
37
37
|
|
38
38
|
Puppet automatically creates a schedule for each of the valid periods
|
39
|
-
with the same name as that period (
|
39
|
+
with the same name as that period (such as hourly and daily).
|
40
40
|
Additionally, a schedule named `puppet` is created and used as the
|
41
41
|
default, with the following attributes:
|
42
42
|
|
@@ -83,7 +83,7 @@ module Puppet
|
|
83
83
|
This is mostly useful for restricting certain resources to being
|
84
84
|
applied in maintenance windows or during off-peak hours. Multiple
|
85
85
|
ranges can be applied in array context. As a convenience when specifying
|
86
|
-
ranges, you
|
86
|
+
ranges, you can cross midnight (for example, `range => "22:00 - 04:00"`).
|
87
87
|
EOT
|
88
88
|
|
89
89
|
# This is lame; properties all use arrays as values, but parameters don't.
|
@@ -225,9 +225,9 @@ module Puppet
|
|
225
225
|
end
|
226
226
|
|
227
227
|
newparam(:periodmatch) do
|
228
|
-
desc "Whether periods should be matched by
|
229
|
-
are in the same hour) or by
|
230
|
-
60 minutes apart)."
|
228
|
+
desc "Whether periods should be matched by a numeric value (for instance,
|
229
|
+
whether two times are in the same hour) or by their chronological
|
230
|
+
distance apart (whether two times are 60 minutes apart)."
|
231
231
|
|
232
232
|
newvalues(:number, :distance)
|
233
233
|
|
@@ -241,8 +241,8 @@ module Puppet
|
|
241
241
|
|
242
242
|
Note that the period defines how often a given resource will get
|
243
243
|
applied but not when; if you would like to restrict the hours
|
244
|
-
that a given resource can be applied (
|
245
|
-
a maintenance window), then use the `range` attribute.
|
244
|
+
that a given resource can be applied (for instance, only at night
|
245
|
+
during a maintenance window), then use the `range` attribute.
|
246
246
|
|
247
247
|
If the provided periods are not sufficient, you can provide a
|
248
248
|
value to the *repeat* attribute, which will cause Puppet to
|
@@ -258,9 +258,9 @@ module Puppet
|
|
258
258
|
|
259
259
|
At the moment, Puppet cannot guarantee that level of repetition; that
|
260
260
|
is, the resource can applied _up to_ every 10 minutes, but internal
|
261
|
-
factors might prevent it from actually running that often (
|
262
|
-
Puppet run is still in progress when the next run is scheduled to
|
263
|
-
that next run will be suppressed).
|
261
|
+
factors might prevent it from actually running that often (for instance,
|
262
|
+
if a Puppet run is still in progress when the next run is scheduled to
|
263
|
+
start, that next run will be suppressed).
|
264
264
|
|
265
265
|
See the `periodmatch` attribute for tuning whether to match
|
266
266
|
times by their distance apart or by their specific value.
|
@@ -107,10 +107,10 @@ Puppet::Type.newtype(:scheduled_task) do
|
|
107
107
|
minutes_interval.
|
108
108
|
* For `daily` triggers:
|
109
109
|
* `every` --- How often the task should run, as a number of days. Defaults
|
110
|
-
to 1. ("2" means every other day, "3" means every three days,
|
110
|
+
to 1. ("2" means every other day, "3" means every three days, and so on)
|
111
111
|
* For `weekly` triggers:
|
112
112
|
* `every` --- How often the task should run, as a number of weeks. Defaults
|
113
|
-
to 1. ("2" means every other week, "3" means every three weeks,
|
113
|
+
to 1. ("2" means every other week, "3" means every three weeks, and so on)
|
114
114
|
* `day_of_week` --- Which days of the week the task should run, as an array.
|
115
115
|
Defaults to all days. Each day must be one of `mon`, `tues`,
|
116
116
|
`wed`, `thurs`, `fri`, `sat`, `sun`, or `all`.
|
@@ -66,8 +66,8 @@ module Puppet
|
|
66
66
|
Make sure to omit the following in this attribute (and specify them in
|
67
67
|
other attributes):
|
68
68
|
|
69
|
-
* Key headers
|
70
|
-
* Key identifiers / comments
|
69
|
+
* Key headers, such as 'ssh-rsa' --- put these in the `type` attribute.
|
70
|
+
* Key identifiers / comments, such as 'joe@joescomputer.local' --- put these in
|
71
71
|
the `name` attribute/resource title."
|
72
72
|
|
73
73
|
validate do |value|
|
@@ -82,9 +82,9 @@ module Puppet
|
|
82
82
|
|
83
83
|
newproperty(:target) do
|
84
84
|
desc "The absolute filename in which to store the SSH key. This
|
85
|
-
property is optional and should
|
86
|
-
are stored in a non-standard location
|
87
|
-
`~user/.ssh/authorized_keys
|
85
|
+
property is optional and should be used only in cases where keys
|
86
|
+
are stored in a non-standard location, for instance when not in
|
87
|
+
`~user/.ssh/authorized_keys`."
|
88
88
|
|
89
89
|
defaultto :absent
|
90
90
|
|
@@ -25,8 +25,8 @@ module Puppet
|
|
25
25
|
Make sure to omit the following in this attribute (and specify them in
|
26
26
|
other attributes):
|
27
27
|
|
28
|
-
* Key headers
|
29
|
-
* Key identifiers / comments
|
28
|
+
* Key headers, such as 'ssh-rsa' --- put these in the `type` attribute.
|
29
|
+
* Key identifiers / comments, such as 'joescomputer.local' --- put these in
|
30
30
|
the `name` attribute/resource title."
|
31
31
|
end
|
32
32
|
|
@@ -105,7 +105,7 @@ Puppet::Type.newtype(:tidy) do
|
|
105
105
|
desc "Tidy files whose age is equal to or greater than
|
106
106
|
the specified time. You can choose seconds, minutes,
|
107
107
|
hours, days, or weeks by specifying the first letter of any
|
108
|
-
of those words (
|
108
|
+
of those words (for example, '1w' represents one week).
|
109
109
|
|
110
110
|
Specifying 0 will remove all files."
|
111
111
|
|
@@ -224,7 +224,14 @@ Puppet::Type.newtype(:tidy) do
|
|
224
224
|
# Make a file resource to remove a given file.
|
225
225
|
def mkfile(path)
|
226
226
|
# Force deletion, so directories actually get deleted.
|
227
|
-
|
227
|
+
parameters = {
|
228
|
+
:path => path, :backup => self[:backup],
|
229
|
+
:ensure => :absent, :force => true
|
230
|
+
}
|
231
|
+
|
232
|
+
parameters[:noop] = self[:noop] unless self[:noop].nil?
|
233
|
+
|
234
|
+
Puppet::Type.type(:file).new(parameters)
|
228
235
|
end
|
229
236
|
|
230
237
|
def retrieve
|
@@ -411,7 +411,7 @@ module Puppet
|
|
411
411
|
a zero-padded YYYY-MM-DD format -- for example, 2010-02-19."
|
412
412
|
|
413
413
|
newvalues :absent
|
414
|
-
newvalues
|
414
|
+
newvalues(/^\d{4}-\d{2}-\d{2}$/)
|
415
415
|
|
416
416
|
validate do |value|
|
417
417
|
if value.intern != :absent and value !~ /^\d{4}-\d{2}-\d{2}$/
|
@@ -165,7 +165,8 @@ Puppet::Type.newtype(:yumrepo) do
|
|
165
165
|
end
|
166
166
|
|
167
167
|
newproperty(:exclude) do
|
168
|
-
desc "
|
168
|
+
desc "The string of package names or shell globs separated by spaces to exclude.
|
169
|
+
Packages that match the package name given or shell globs will never be
|
169
170
|
considered in updates or installs for this repo.
|
170
171
|
#{ABSENT_DOC}"
|
171
172
|
|
@@ -187,9 +188,10 @@ Puppet::Type.newtype(:yumrepo) do
|
|
187
188
|
end
|
188
189
|
|
189
190
|
newproperty(:includepkgs) do
|
190
|
-
desc "
|
191
|
-
matching one of the
|
192
|
-
|
191
|
+
desc "The string of package names or shell globs separated by spaces to
|
192
|
+
include. If this is set, only packages matching one of the package
|
193
|
+
names or shell globs will be considered for update or install
|
194
|
+
from this repository. #{ABSENT_DOC}"
|
193
195
|
|
194
196
|
newvalues(/.*/, :absent)
|
195
197
|
end
|
@@ -415,4 +417,23 @@ Puppet::Type.newtype(:yumrepo) do
|
|
415
417
|
|
416
418
|
newvalues(/^\d+$/, :absent)
|
417
419
|
end
|
420
|
+
|
421
|
+
newproperty(:username) do
|
422
|
+
desc "Username to use for basic authentication to a repo or really any url.
|
423
|
+
#{ABSENT_DOC}"
|
424
|
+
newvalues(/.*/, :absent)
|
425
|
+
end
|
426
|
+
|
427
|
+
newproperty(:password) do
|
428
|
+
desc "Password to use with the username for basic authentication.
|
429
|
+
#{ABSENT_DOC}"
|
430
|
+
newvalues(/.*/, :absent)
|
431
|
+
end
|
432
|
+
|
433
|
+
private
|
434
|
+
|
435
|
+
def set_sensitive_parameters(sensitive_parameters)
|
436
|
+
parameter(:password).sensitive = true if parameter(:password)
|
437
|
+
super(sensitive_parameters)
|
438
|
+
end
|
418
439
|
end
|
@@ -20,6 +20,10 @@ parent zfs instances, the zfs resource will autorequire them."
|
|
20
20
|
desc "The aclmode property. Valid values are `discard`, `groupmask`, `passthrough`."
|
21
21
|
end
|
22
22
|
|
23
|
+
newproperty(:acltype) do
|
24
|
+
desc "The acltype propery. Valid values are 'noacl' and 'posixacl'. Only supported on Linux."
|
25
|
+
end
|
26
|
+
|
23
27
|
newproperty(:atime) do
|
24
28
|
desc "The atime property. Valid values are `on`, `off`."
|
25
29
|
end
|
@@ -366,12 +366,8 @@ module Util
|
|
366
366
|
end
|
367
367
|
module_function :uri_to_path
|
368
368
|
|
369
|
-
private
|
370
|
-
|
371
369
|
RFC_3986_URI_REGEX = /^(?<scheme>([^:\/?#]+):)?(?<authority>\/\/([^\/?#]*))?(?<path>[^?#]*)(\?(?<query>[^#]*))?(#(?<fragment>.*))?$/
|
372
370
|
|
373
|
-
public
|
374
|
-
|
375
371
|
# Percent-encodes a URI query parameter per RFC3986 - https://tools.ietf.org/html/rfc3986
|
376
372
|
#
|
377
373
|
# The output will correctly round-trip through URI.unescape
|
@@ -157,8 +157,10 @@ module Puppet::Util::HttpProxy
|
|
157
157
|
proxy
|
158
158
|
end
|
159
159
|
|
160
|
-
# Retrieve a document through HTTP(s), following redirects if necessary.
|
161
|
-
#
|
160
|
+
# Retrieve a document through HTTP(s), following redirects if necessary. The
|
161
|
+
# returned response body may be compressed, and it is the caller's
|
162
|
+
# responsibility to decompress it based on the 'content-encoding' header.
|
163
|
+
#
|
162
164
|
# Based on the the client implementation in the HTTP pool.
|
163
165
|
#
|
164
166
|
# @see Puppet::Network::HTTP::Connection#request_with_redirects
|
@@ -148,7 +148,7 @@ module Puppet::Util::IniConfig
|
|
148
148
|
)
|
149
149
|
INI_CONTINUATION = /^[ \t\r\n\f]/
|
150
150
|
INI_SECTION_NAME = /^\[([^\]]+)\]/
|
151
|
-
INI_PROPERTY = /^\s*([^\s=]+)\s
|
151
|
+
INI_PROPERTY = /^\s*([^\s=]+)\s*\=\s*(.*)$/
|
152
152
|
|
153
153
|
# @api private
|
154
154
|
def parse(text)
|
@@ -177,10 +177,9 @@ module Puppet::Util::IniConfig
|
|
177
177
|
section = add_section(section_name)
|
178
178
|
optname = nil
|
179
179
|
elsif (match = l.match(INI_PROPERTY))
|
180
|
-
#
|
181
|
-
# For the values, we don't know if space is significant
|
180
|
+
# the regex strips leading white space from the value, and here we strip the trailing white space as well
|
182
181
|
key = match[1]
|
183
|
-
val = match[2]
|
182
|
+
val = match[2].rstrip
|
184
183
|
|
185
184
|
if section.nil?
|
186
185
|
raise IniParseError.new(_("Property with key %{key} outside of a section") % { key: key.inspect })
|
@@ -164,8 +164,6 @@ class Puppet::Util::Log
|
|
164
164
|
end
|
165
165
|
end
|
166
166
|
|
167
|
-
private
|
168
|
-
# produces UTF-8 strings or dumps strings when they cannot be re-encoded
|
169
167
|
def Log.coerce_string(str)
|
170
168
|
return Puppet::Util::CharacterEncoding.convert_to_utf_8(str) if str.valid_encoding?
|
171
169
|
|
@@ -175,8 +173,7 @@ class Puppet::Util::Log
|
|
175
173
|
message += '\n' + _("Backtrace:\n%{backtrace}") % { backtrace: caller[0..10].join("\n") }
|
176
174
|
message
|
177
175
|
end
|
178
|
-
|
179
|
-
public
|
176
|
+
private_class_method :coerce_string
|
180
177
|
|
181
178
|
# Route the actual message. FIXME There are lots of things this method
|
182
179
|
# should do, like caching and a bit more. It's worth noting that there's
|
@@ -381,7 +378,7 @@ class Puppet::Util::Log
|
|
381
378
|
def source=(source)
|
382
379
|
if defined?(Puppet::Type) && source.is_a?(Puppet::Type)
|
383
380
|
@source = source.path
|
384
|
-
source
|
381
|
+
merge_tags_from(source)
|
385
382
|
self.file = source.file
|
386
383
|
self.line = source.line
|
387
384
|
else
|
@@ -63,7 +63,7 @@ class Puppet::Util::NetworkDevice::Cisco::Facts
|
|
63
63
|
end
|
64
64
|
|
65
65
|
def uptime_to_seconds(uptime)
|
66
|
-
captures = (uptime.match
|
66
|
+
captures = (uptime.match(/^(?:(\d+) years?,)?\s*(?:(\d+) weeks?,)?\s*(?:(\d+) days?,)?\s*(?:(\d+) hours?,)?\s*(\d+) minutes?$/)).captures
|
67
67
|
captures.zip([31536000, 604800, 86400, 3600, 60]).inject(0) do |total, (x,y)|
|
68
68
|
total + (x.nil? ? 0 : x.to_i * y)
|
69
69
|
end
|
@@ -12,10 +12,6 @@ class Puppet::Util::Reference
|
|
12
12
|
|
13
13
|
instance_load(:reference, 'puppet/reference')
|
14
14
|
|
15
|
-
def self.footer
|
16
|
-
"\n\n----------------\n\n" + _("*This page autogenerated on %{current_time}*\n") % { current_time: Time.now.to_s }
|
17
|
-
end
|
18
|
-
|
19
15
|
def self.modes
|
20
16
|
%w{pdf text}
|
21
17
|
end
|
@@ -111,15 +107,12 @@ class Puppet::Util::Reference
|
|
111
107
|
def to_markdown(withcontents = true)
|
112
108
|
# First the header
|
113
109
|
text = markdown_header(@title, 1)
|
114
|
-
|
115
|
-
text << _("\n\n**This page is autogenerated; any changes will get overwritten** *(last generated on %{current_time})*\n\n") % { current_time: Time.now.to_s }
|
110
|
+
text << _("\n\n**This page is autogenerated; any changes will get overwritten**\n\n")
|
116
111
|
|
117
112
|
text << @header
|
118
113
|
|
119
114
|
text << generate
|
120
115
|
|
121
|
-
text << self.class.footer if withcontents
|
122
|
-
|
123
116
|
text
|
124
117
|
end
|
125
118
|
end
|
@@ -66,7 +66,7 @@ module Puppet::Util::Windows::ADSI
|
|
66
66
|
return sid_uri(sid) if sid.kind_of?(Puppet::Util::Windows::SID::Principal)
|
67
67
|
|
68
68
|
begin
|
69
|
-
sid = Puppet::Util::Windows::SID.
|
69
|
+
sid = Puppet::Util::Windows::SID.name_to_principal(sid)
|
70
70
|
sid_uri(sid)
|
71
71
|
rescue Puppet::Util::Windows::Error, Puppet::Error
|
72
72
|
nil
|
@@ -114,7 +114,7 @@ module Puppet::Util::Windows::ADSI
|
|
114
114
|
Puppet::Util::Windows::SID.sid_to_name('S-1-5-32').upcase,
|
115
115
|
# localized version of NT AUTHORITY (can't use S-1-5)
|
116
116
|
# for instance AUTORITE NT on French Windows
|
117
|
-
Puppet::Util::Windows::SID.
|
117
|
+
Puppet::Util::Windows::SID.name_to_principal('SYSTEM').domain.upcase
|
118
118
|
]
|
119
119
|
end
|
120
120
|
|
@@ -139,10 +139,12 @@ module Puppet::Util::Windows::ADSI
|
|
139
139
|
return account, domain
|
140
140
|
end
|
141
141
|
|
142
|
+
# returns Puppet::Util::Windows::SID::Principal[]
|
143
|
+
# may contain objects that represent unresolvable SIDs
|
142
144
|
def get_sids(adsi_child_collection)
|
143
145
|
sids = []
|
144
146
|
adsi_child_collection.each do |m|
|
145
|
-
sids << Puppet::Util::Windows::SID.
|
147
|
+
sids << Puppet::Util::Windows::SID.ads_to_principal(m)
|
146
148
|
end
|
147
149
|
|
148
150
|
sids
|
@@ -152,7 +154,7 @@ module Puppet::Util::Windows::ADSI
|
|
152
154
|
return {} if names.nil? || names.empty?
|
153
155
|
|
154
156
|
sids = names.map do |name|
|
155
|
-
sid = Puppet::Util::Windows::SID.
|
157
|
+
sid = Puppet::Util::Windows::SID.name_to_principal(name)
|
156
158
|
raise Puppet::Error.new( _("Could not resolve name: %{name}") % { name: name } ) if !sid
|
157
159
|
[sid.sid, sid]
|
158
160
|
end
|
@@ -183,7 +185,7 @@ module Puppet::Util::Windows::ADSI
|
|
183
185
|
end
|
184
186
|
|
185
187
|
def sid
|
186
|
-
@sid ||= Puppet::Util::Windows::SID.
|
188
|
+
@sid ||= Puppet::Util::Windows::SID.octet_string_to_principal(native_user.objectSID)
|
187
189
|
end
|
188
190
|
|
189
191
|
def uri
|
@@ -336,12 +338,12 @@ module Puppet::Util::Windows::ADSI
|
|
336
338
|
end
|
337
339
|
|
338
340
|
def self.current_user_sid
|
339
|
-
Puppet::Util::Windows::SID.
|
341
|
+
Puppet::Util::Windows::SID.name_to_principal(current_user_name)
|
340
342
|
end
|
341
343
|
|
342
344
|
def self.exists?(name_or_sid)
|
343
345
|
well_known = false
|
344
|
-
if (sid = Puppet::Util::Windows::SID.
|
346
|
+
if (sid = Puppet::Util::Windows::SID.name_to_principal(name_or_sid))
|
345
347
|
return true if sid.account_type == :SidTypeUser
|
346
348
|
|
347
349
|
# 'well known group' is special as it can be a group like Everyone OR a user like SYSTEM
|
@@ -431,7 +433,7 @@ module Puppet::Util::Windows::ADSI
|
|
431
433
|
end
|
432
434
|
|
433
435
|
def sid
|
434
|
-
@sid ||= Puppet::Util::Windows::SID.
|
436
|
+
@sid ||= Puppet::Util::Windows::SID.octet_string_to_principal(native_group.objectSID)
|
435
437
|
end
|
436
438
|
|
437
439
|
def commit
|
@@ -463,18 +465,13 @@ module Puppet::Util::Windows::ADSI
|
|
463
465
|
end
|
464
466
|
end
|
465
467
|
|
468
|
+
# returns Puppet::Util::Windows::SID::Principal[]
|
469
|
+
# may contain objects that represent unresolvable SIDs
|
470
|
+
# qualified account names are returned by calling #domain_account
|
466
471
|
def members
|
467
|
-
# WIN32OLE objects aren't enumerable, so no map
|
468
|
-
members = []
|
469
|
-
# Setting WIN32OLE.codepage in the microsoft_windows feature ensures
|
470
|
-
# values are returned as UTF-8
|
471
|
-
native_group.Members.each {|m| members << m.Name}
|
472
|
-
members
|
473
|
-
end
|
474
|
-
|
475
|
-
def member_sids
|
476
472
|
self.class.get_sids(native_group.Members)
|
477
473
|
end
|
474
|
+
alias member_sids members
|
478
475
|
|
479
476
|
def set_members(desired_members, inclusive = true)
|
480
477
|
return if desired_members.nil?
|
@@ -508,7 +505,7 @@ module Puppet::Util::Windows::ADSI
|
|
508
505
|
|
509
506
|
def self.exists?(name_or_sid)
|
510
507
|
well_known = false
|
511
|
-
if (sid = Puppet::Util::Windows::SID.
|
508
|
+
if (sid = Puppet::Util::Windows::SID.name_to_principal(name_or_sid))
|
512
509
|
return true if sid.account_type == :SidTypeGroup
|
513
510
|
|
514
511
|
# 'well known group' is special as it can be a group like Everyone OR a user like SYSTEM
|