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
@@ -92,7 +92,9 @@ Puppet::Type.type(:group).provide :groupadd, :parent => Puppet::Provider::NameSe
|
|
92
92
|
cmd = [command(:modify)]
|
93
93
|
end
|
94
94
|
cmd << flag(param) << value
|
95
|
-
|
95
|
+
# TODO the group type only really manages gid, so there are currently no
|
96
|
+
# tests for this behavior
|
97
|
+
cmd += check_allow_dup if param == :gid
|
96
98
|
cmd << @resource[:name]
|
97
99
|
|
98
100
|
cmd
|
@@ -23,12 +23,9 @@ Puppet::Type.type(:group).provide :windows_adsi do
|
|
23
23
|
# Cannot use munge of the group property to canonicalize @should
|
24
24
|
# since the default array_matching comparison is not commutative
|
25
25
|
|
26
|
+
current_sids = current.map(&:sid)
|
26
27
|
# dupes automatically weeded out when hashes built
|
27
|
-
|
28
|
-
specified_users = Puppet::Util::Windows::ADSI::Group.name_sid_hash(should)
|
29
|
-
|
30
|
-
current_sids = current_users.keys.to_a
|
31
|
-
specified_sids = specified_users.keys.to_a
|
28
|
+
specified_sids = Puppet::Util::Windows::ADSI::Group.name_sid_hash(should).keys.to_a
|
32
29
|
|
33
30
|
if @resource[:auth_membership]
|
34
31
|
current_sids.sort == specified_sids.sort
|
@@ -40,7 +37,7 @@ Puppet::Type.type(:group).provide :windows_adsi do
|
|
40
37
|
def members_to_s(users)
|
41
38
|
return '' if users.nil? or !users.kind_of?(Array)
|
42
39
|
users = users.map do |user_name|
|
43
|
-
sid = Puppet::Util::Windows::SID.
|
40
|
+
sid = Puppet::Util::Windows::SID.name_to_principal(user_name)
|
44
41
|
if !sid
|
45
42
|
resource.debug("#{user_name} (unresolvable to SID)")
|
46
43
|
next user_name
|
@@ -58,7 +55,7 @@ Puppet::Type.type(:group).provide :windows_adsi do
|
|
58
55
|
end
|
59
56
|
|
60
57
|
def member_valid?(user_name)
|
61
|
-
! Puppet::Util::Windows::SID.
|
58
|
+
! Puppet::Util::Windows::SID.name_to_principal(user_name).nil?
|
62
59
|
end
|
63
60
|
|
64
61
|
def group
|
@@ -174,7 +174,7 @@ class Puppet::Provider::NameService < Puppet::Provider
|
|
174
174
|
begin
|
175
175
|
execute(self.addcmd, {:failonfail => true, :combine => true, :custom_environment => @custom_environment})
|
176
176
|
if feature?(:manages_password_age) && (cmd = passcmd)
|
177
|
-
execute(cmd)
|
177
|
+
execute(cmd, {:failonfail => true, :combine => true, :custom_environment => @custom_environment})
|
178
178
|
end
|
179
179
|
rescue Puppet::ExecutionFailure => detail
|
180
180
|
raise Puppet::Error, _("Could not create %{resource} %{name}: %{detail}") % { resource: @resource.class.name, name: @resource.name, detail: detail }, detail.backtrace
|
@@ -189,7 +189,7 @@ class Puppet::Provider::NameService < Puppet::Provider
|
|
189
189
|
end
|
190
190
|
|
191
191
|
begin
|
192
|
-
execute(self.deletecmd)
|
192
|
+
execute(self.deletecmd, {:failonfail => true, :combine => true, :custom_environment => @custom_environment})
|
193
193
|
rescue Puppet::ExecutionFailure => detail
|
194
194
|
raise Puppet::Error, _("Could not delete %{resource} %{name}: %{detail}") % { resource: @resource.class.name, name: @resource.name, detail: detail }, detail.backtrace
|
195
195
|
end
|
@@ -301,7 +301,7 @@ class Puppet::Provider::NameService < Puppet::Provider
|
|
301
301
|
cmd = modifycmd(param, munge(param, value))
|
302
302
|
raise Puppet::DevError, _("Nameservice command must be an array") unless cmd.is_a?(Array)
|
303
303
|
begin
|
304
|
-
execute(cmd)
|
304
|
+
execute(cmd, {:failonfail => true, :combine => true, :custom_environment => @custom_environment})
|
305
305
|
rescue Puppet::ExecutionFailure => detail
|
306
306
|
raise Puppet::Error, _("Could not set %{param} on %{resource}[%{name}]: %{detail}") % { param: param, resource: @resource.class.name, name: @resource.name, detail: detail }, detail.backtrace
|
307
307
|
end
|
@@ -28,7 +28,7 @@ Puppet::Type.type(:package).provide :dnf, :parent => :yum do
|
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
31
|
-
defaultfor :operatingsystem => :fedora, :operatingsystemmajrelease =>
|
31
|
+
defaultfor :operatingsystem => :fedora, :operatingsystemmajrelease => (22..30).to_a
|
32
32
|
|
33
33
|
def self.update_command
|
34
34
|
# In DNF, update is deprecated for upgrade
|
@@ -58,7 +58,7 @@ Puppet::Type.type(:package).provide :gem, :parent => Puppet::Provider::Package d
|
|
58
58
|
|
59
59
|
if desc =~ /^(\S+)\s+\((.+)\)/
|
60
60
|
gem_name = $1
|
61
|
-
versions = $2.split(/,\s*/)
|
61
|
+
versions = $2.sub('default: ', '').split(/,\s*/)
|
62
62
|
{
|
63
63
|
:name => gem_name,
|
64
64
|
:ensure => versions.map{|v| v.split[0]},
|
@@ -209,9 +209,9 @@ Puppet::Type.type(:package).provide :pacman, :parent => Puppet::Provider::Packag
|
|
209
209
|
cmd << resource_name
|
210
210
|
|
211
211
|
if self.class.yaourt?
|
212
|
-
yaourt
|
212
|
+
yaourt(*cmd)
|
213
213
|
else
|
214
|
-
pacman
|
214
|
+
pacman(*cmd)
|
215
215
|
end
|
216
216
|
end
|
217
217
|
|
@@ -258,9 +258,9 @@ Puppet::Type.type(:package).provide :pacman, :parent => Puppet::Provider::Packag
|
|
258
258
|
cmd << "-Sy" << resource_name
|
259
259
|
|
260
260
|
if self.class.yaourt?
|
261
|
-
yaourt
|
261
|
+
yaourt(*cmd)
|
262
262
|
else
|
263
|
-
pacman
|
263
|
+
pacman(*cmd)
|
264
264
|
end
|
265
265
|
end
|
266
266
|
|
@@ -117,7 +117,7 @@ Puppet::Type.type(:package).provide :pip,
|
|
117
117
|
args << @resource[:name]
|
118
118
|
end
|
119
119
|
end
|
120
|
-
lazy_pip
|
120
|
+
lazy_pip(*args)
|
121
121
|
end
|
122
122
|
|
123
123
|
# Uninstall a package. Uninstall won't work reliably on Debian/Ubuntu
|
@@ -135,7 +135,7 @@ Puppet::Type.type(:package).provide :pip,
|
|
135
135
|
# try to teach it and if even that fails, raise the error.
|
136
136
|
private
|
137
137
|
def lazy_pip(*args)
|
138
|
-
pip
|
138
|
+
pip(*args)
|
139
139
|
rescue NoMethodError => e
|
140
140
|
# Ensure pip can upgrade pip, which usually puts pip into a new path /usr/local/bin/pip (compared to /usr/bin/pip)
|
141
141
|
# The path to pip needs to be looked up again in the subsequent request. Using the preferred approach as noted
|
@@ -145,7 +145,7 @@ Puppet::Type.type(:package).provide :pip,
|
|
145
145
|
# to search for them using the PATH variable.
|
146
146
|
if pathname = self.class.cmd.map { |c| which(c) }.find { |c| c != nil }
|
147
147
|
self.class.commands :pip => File.basename(pathname)
|
148
|
-
pip
|
148
|
+
pip(*args)
|
149
149
|
else
|
150
150
|
raise e, "Could not locate command #{self.class.cmd.join(' and ')}.", e.backtrace
|
151
151
|
end
|
@@ -90,9 +90,9 @@ Puppet::Type.type(:package).provide :pkgdmg, :parent => Puppet::Provider::Packag
|
|
90
90
|
elsif http_proxy_host and not http_proxy_port
|
91
91
|
args << "--proxy" << http_proxy_host
|
92
92
|
end
|
93
|
-
|
94
|
-
|
95
|
-
|
93
|
+
begin
|
94
|
+
curl(*args)
|
95
|
+
Puppet.debug "Success: curl transferred [#{name}] (via: curl #{args.join(" ")})"
|
96
96
|
rescue Puppet::ExecutionFailure
|
97
97
|
Puppet.debug "curl #{args.join(" ")} did not transfer [#{name}]. Falling back to local file." # This used to fall back to open-uri. -NF
|
98
98
|
cached_source = source
|
@@ -152,9 +152,9 @@ Puppet::Type.type(:package).provide :pkgutil, :parent => :sun, :source => :sun d
|
|
152
152
|
# get passed to pkgutil via one or more -t options
|
153
153
|
if resource[:source]
|
154
154
|
sources = [resource[:source]].flatten
|
155
|
-
pkguti
|
155
|
+
pkguti(*[sources.map{|src| [ "-t", src ]}, *args].flatten)
|
156
156
|
else
|
157
|
-
pkguti
|
157
|
+
pkguti(*args.flatten)
|
158
158
|
end
|
159
159
|
end
|
160
160
|
|
@@ -40,7 +40,7 @@ Puppet::Type.type(:package).provide :portage, :parent => Puppet::Provider::Packa
|
|
40
40
|
|
41
41
|
search_output = nil
|
42
42
|
Puppet::Util.withenv :EIX_LIMIT => limit, :LASTVERSION => version_format, :LASTSLOTVERSIONS => slot_versions_format, :INSTALLEDVERSIONS => installed_versions_format, :STABLEVERSIONS => installable_versions_format do
|
43
|
-
search_output = eix
|
43
|
+
search_output = eix(*(self.eix_search_arguments + ['--installed']))
|
44
44
|
end
|
45
45
|
|
46
46
|
packages = []
|
@@ -74,7 +74,7 @@ Puppet::Type.type(:package).provide :portage, :parent => Puppet::Provider::Packa
|
|
74
74
|
cmd << '--update' if [:latest].include?(should)
|
75
75
|
cmd += install_options if @resource[:install_options]
|
76
76
|
cmd << name
|
77
|
-
emerge
|
77
|
+
emerge(*cmd)
|
78
78
|
end
|
79
79
|
|
80
80
|
def uninstall
|
@@ -89,10 +89,10 @@ Puppet::Type.type(:package).provide :portage, :parent => Puppet::Provider::Packa
|
|
89
89
|
cmd << name
|
90
90
|
if [:purged].include?(should)
|
91
91
|
Puppet::Util.withenv :CONFIG_PROTECT => "-*" do
|
92
|
-
emerge
|
92
|
+
emerge(*cmd)
|
93
93
|
end
|
94
94
|
else
|
95
|
-
emerge
|
95
|
+
emerge(*cmd)
|
96
96
|
end
|
97
97
|
end
|
98
98
|
|
@@ -111,7 +111,7 @@ Puppet::Type.type(:package).provide :portage, :parent => Puppet::Provider::Packa
|
|
111
111
|
@atom ||= begin
|
112
112
|
package_info = {}
|
113
113
|
# do the search
|
114
|
-
search_output = qatom_bin
|
114
|
+
search_output = qatom_bin(*([@resource[:name], '--format', output_format]))
|
115
115
|
# verify if the search found anything
|
116
116
|
match = result_format.match(search_output)
|
117
117
|
if match
|
@@ -146,7 +146,7 @@ Puppet::Type.type(:package).provide :portage, :parent => Puppet::Provider::Packa
|
|
146
146
|
|
147
147
|
def self.get_sets
|
148
148
|
@sets ||= begin
|
149
|
-
@sets = emerge
|
149
|
+
@sets = emerge(*(['--list-sets']))
|
150
150
|
end
|
151
151
|
end
|
152
152
|
|
@@ -170,8 +170,8 @@ Puppet::Type.type(:package).provide :portage, :parent => Puppet::Provider::Packa
|
|
170
170
|
end
|
171
171
|
|
172
172
|
if @resource[:name].match(/^@/)
|
173
|
-
|
174
|
-
|
173
|
+
if package_sets.include?(@resource[:name][1..-1].to_s)
|
174
|
+
return({:name => "#{@resource[:name]}", :ensure => '9999', :version_available => nil, :installed_versions => nil, :installable_versions => "9999,"})
|
175
175
|
end
|
176
176
|
end
|
177
177
|
|
@@ -180,7 +180,7 @@ Puppet::Type.type(:package).provide :portage, :parent => Puppet::Provider::Packa
|
|
180
180
|
|
181
181
|
search_output = nil
|
182
182
|
Puppet::Util.withenv :EIX_LIMIT => limit, :LASTVERSION => version_format, :LASTSLOTVERSIONS => slot_versions_format, :INSTALLEDVERSIONS => installed_versions_format, :STABLEVERSIONS => installable_versions_format do
|
183
|
-
search_output = eix
|
183
|
+
search_output = eix(*(self.class.eix_search_arguments + ['--exact',search_field,search_value]))
|
184
184
|
end
|
185
185
|
|
186
186
|
packages = []
|
@@ -102,7 +102,7 @@ Puppet::Type.type(:package).provide :zypper, :parent => :rpm do
|
|
102
102
|
options << '--name' unless major < 1 || @resource.allow_virtual? || should
|
103
103
|
options << wanted
|
104
104
|
|
105
|
-
zypper
|
105
|
+
zypper(*options)
|
106
106
|
|
107
107
|
unless self.query
|
108
108
|
raise Puppet::ExecutionFailure.new(
|
@@ -138,7 +138,7 @@ Puppet::Type.type(:package).provide :zypper, :parent => :rpm do
|
|
138
138
|
|
139
139
|
options << @resource[:name]
|
140
140
|
|
141
|
-
zypper
|
141
|
+
zypper(*options)
|
142
142
|
end
|
143
143
|
|
144
144
|
end
|
@@ -25,8 +25,9 @@ Puppet::Type.type(:service).provide :smf, :parent => :base do
|
|
25
25
|
|
26
26
|
def setupservice
|
27
27
|
if resource[:manifest]
|
28
|
-
|
29
|
-
|
28
|
+
begin
|
29
|
+
svcs("-l", @resource[:name])
|
30
|
+
rescue Puppet::ExecutionFailure
|
30
31
|
Puppet.notice "Importing #{@resource[:manifest]} for #{@resource[:name]}"
|
31
32
|
svccfg :import, resource[:manifest]
|
32
33
|
end
|
@@ -188,13 +188,17 @@ Puppet::Type.type(:user).provide :useradd, :parent => Puppet::Provider::NameServ
|
|
188
188
|
|
189
189
|
def modifycmd(param, value)
|
190
190
|
if @resource.forcelocal?
|
191
|
-
|
191
|
+
if param == :groups
|
192
|
+
cmd = [command(:modify)]
|
193
|
+
else
|
194
|
+
cmd = [command(property_manages_password_age?(param) ? :localpassword : :localmodify)]
|
195
|
+
end
|
192
196
|
@custom_environment = Puppet::Util::Libuser.getenv
|
193
197
|
else
|
194
198
|
cmd = [command(property_manages_password_age?(param) ? :password : :modify)]
|
195
199
|
end
|
196
200
|
cmd << flag(param) << value
|
197
|
-
cmd += check_allow_dup
|
201
|
+
cmd += check_allow_dup if param == :uid
|
198
202
|
cmd << @resource[:name]
|
199
203
|
|
200
204
|
cmd
|
@@ -52,7 +52,7 @@ Puppet::Type.type(:user).provide :windows_adsi do
|
|
52
52
|
def groups_to_s(groups)
|
53
53
|
return '' if groups.nil? || !groups.kind_of?(Array)
|
54
54
|
groups = groups.map do |group_name|
|
55
|
-
sid = Puppet::Util::Windows::SID.
|
55
|
+
sid = Puppet::Util::Windows::SID.name_to_principal(group_name)
|
56
56
|
if sid.account =~ /\\/
|
57
57
|
account, _ = Puppet::Util::Windows::ADSI::Group.parse_name(sid.account)
|
58
58
|
else
|
@@ -26,7 +26,7 @@ Puppet::Type.type(:zfs).provide(:zfs) do
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def create
|
29
|
-
zfs
|
29
|
+
zfs(*([:create] + add_properties + [@resource[:name]]))
|
30
30
|
end
|
31
31
|
|
32
32
|
def destroy
|
@@ -57,8 +57,9 @@ Puppet::Type.type(:zfs).provide(:zfs) do
|
|
57
57
|
# https://docs.oracle.com/cd/E19963-01/html/821-1448/gbscy.html
|
58
58
|
# shareiscsi (added in build 120) was removed from S11 build 136
|
59
59
|
# aclmode was removed from S11 in build 139 but it may have been added back
|
60
|
+
# acltype is for ZFS on Linux, and allows disabling or enabling POSIX ACLs
|
60
61
|
# http://webcache.googleusercontent.com/search?q=cache:-p74K0DVsdwJ:developers.slashdot.org/story/11/11/09/2343258/solaris-11-released+&cd=13
|
61
|
-
[:aclmode, :shareiscsi].each do |field|
|
62
|
+
[:aclmode, :acltype, :shareiscsi].each do |field|
|
62
63
|
# The zfs commands use the property value '-' to indicate that the
|
63
64
|
# property is not set. We make use of this value to indicate that the
|
64
65
|
# property is not set since it is not available. Conversely, if these
|
@@ -34,6 +34,8 @@ config = Puppet::Util::Reference.newreference(:configuration, :depth => 1, :doc
|
|
34
34
|
val = 'Unix/Linux: /var/log/puppetlabs/puppet -- Windows: C:\ProgramData\PuppetLabs\puppet\var\log -- Non-root user: ~/.puppetlabs/var/log'
|
35
35
|
elsif name.to_s == 'hiera_config'
|
36
36
|
val = '$confdir/hiera.yaml. However, if a file exists at $codedir/hiera.yaml, Puppet uses that instead.'
|
37
|
+
elsif name.to_s == 'certname'
|
38
|
+
val = "the Host's fully qualified domain name, as determined by facter"
|
37
39
|
end
|
38
40
|
|
39
41
|
# Leave out the section information; it was apparently confusing people.
|
@@ -47,25 +47,25 @@ Puppet::Util::Reference.newreference :type, :doc => "All Puppet resource types a
|
|
47
47
|
Resource types define features they can use, and providers can be tested to see
|
48
48
|
which features they provide.
|
49
49
|
|
50
|
-
|
50
|
+
}
|
51
51
|
|
52
|
-
|
53
|
-
|
54
|
-
|
52
|
+
types.sort { |a,b|
|
53
|
+
a.to_s <=> b.to_s
|
54
|
+
}.each { |name,type|
|
55
55
|
|
56
|
-
|
56
|
+
str << "
|
57
57
|
|
58
58
|
----------------
|
59
59
|
|
60
60
|
"
|
61
61
|
|
62
|
-
|
63
|
-
|
62
|
+
str << markdown_header(name, 3)
|
63
|
+
str << scrub(type.doc) + "\n\n"
|
64
64
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
65
|
+
# Handle the feature docs.
|
66
|
+
if featuredocs = type.featuredocs
|
67
|
+
str << markdown_header("Features", 4)
|
68
|
+
str << featuredocs
|
69
69
|
end
|
70
70
|
|
71
71
|
docs = {}
|
@@ -110,8 +110,6 @@ module Puppet::Resource::CapabilityFinder
|
|
110
110
|
end
|
111
111
|
end
|
112
112
|
|
113
|
-
private
|
114
|
-
|
115
113
|
# Find a distinct copy of the given capability resource by searching for only
|
116
114
|
# resources matching the given code_id. Returns `nil` if no code_id is
|
117
115
|
# supplied or if there isn't exactly one matching resource.
|
@@ -132,6 +130,7 @@ module Puppet::Resource::CapabilityFinder
|
|
132
130
|
end
|
133
131
|
end
|
134
132
|
end
|
133
|
+
private_class_method :disambiguate_by_code_id
|
135
134
|
|
136
135
|
def self.instantiate_resource(resource_hash)
|
137
136
|
real_type = resource_hash['type']
|
@@ -147,4 +146,5 @@ module Puppet::Resource::CapabilityFinder
|
|
147
146
|
end
|
148
147
|
return resource
|
149
148
|
end
|
149
|
+
private_class_method :instantiate_resource
|
150
150
|
end
|
@@ -595,7 +595,7 @@ class Puppet::Resource::Catalog < Puppet::Graph::SimpleGraph
|
|
595
595
|
transaction = Puppet::Transaction.new(self, options[:report], prioritizer)
|
596
596
|
transaction.tags = options[:tags] if options[:tags]
|
597
597
|
transaction.ignoreschedules = true if options[:ignoreschedules]
|
598
|
-
transaction.for_network_device = options[:network_device]
|
598
|
+
transaction.for_network_device = Puppet.lookup(:network_device) { nil } || options[:network_device]
|
599
599
|
|
600
600
|
transaction
|
601
601
|
end
|
@@ -671,7 +671,7 @@ class Puppet::Resource::Catalog < Puppet::Graph::SimpleGraph
|
|
671
671
|
map.clear
|
672
672
|
|
673
673
|
result.add_class(*self.classes)
|
674
|
-
result.
|
674
|
+
result.merge_tags_from(self)
|
675
675
|
|
676
676
|
result
|
677
677
|
end
|
@@ -31,7 +31,7 @@ module Puppet
|
|
31
31
|
|
32
32
|
# Boolean status types set while evaluating `@real_resource`.
|
33
33
|
STATES = [:skipped, :failed, :failed_to_restart, :restarted, :changed, :out_of_sync, :scheduled, :corrective_change]
|
34
|
-
attr_accessor
|
34
|
+
attr_accessor(*STATES)
|
35
35
|
|
36
36
|
# @!attribute [r] source_description
|
37
37
|
# @return [String] The textual description of the path to `@real_resource`
|
@@ -74,6 +74,10 @@ module Puppet
|
|
74
74
|
# @return [String] The class name of `@real_resource`
|
75
75
|
attr_reader :resource_type
|
76
76
|
|
77
|
+
# @!attribute [rw] provider_used
|
78
|
+
# @return [String] The class name of the provider used for the resource
|
79
|
+
attr_accessor :provider_used
|
80
|
+
|
77
81
|
# @!attribute [r] title
|
78
82
|
# @return [String] The title of `@real_resource`
|
79
83
|
attr_reader :title
|
@@ -163,15 +167,17 @@ module Puppet
|
|
163
167
|
@file = resource.file
|
164
168
|
@line = resource.line
|
165
169
|
|
166
|
-
|
170
|
+
merge_tags_from(resource)
|
167
171
|
@time = Time.now
|
168
172
|
@events = []
|
169
173
|
@resource_type = resource.type.to_s.capitalize
|
174
|
+
@provider_used = resource.provider.class.name.to_s unless resource.provider.nil?
|
170
175
|
@title = resource.title
|
171
176
|
end
|
172
177
|
|
173
178
|
def initialize_from_hash(data)
|
174
179
|
@resource_type = data['resource_type']
|
180
|
+
@provider_used = data['provider_used']
|
175
181
|
@title = data['title']
|
176
182
|
@resource = data['resource']
|
177
183
|
@containment_path = data['containment_path']
|
@@ -201,6 +207,7 @@ module Puppet
|
|
201
207
|
'line' => @line,
|
202
208
|
'resource' => @resource,
|
203
209
|
'resource_type' => @resource_type,
|
210
|
+
'provider_used' => @provider_used,
|
204
211
|
'containment_path' => @containment_path,
|
205
212
|
'evaluation_time' => @evaluation_time,
|
206
213
|
'tags' => @tags.to_a,
|