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.

Files changed (224) hide show
  1. checksums.yaml +4 -4
  2. data/bolt-modules/boltlib/lib/puppet/functions/run_task.rb +25 -13
  3. data/lib/bolt/cli.rb +45 -15
  4. data/lib/bolt/config.rb +48 -132
  5. data/lib/bolt/executor.rb +3 -10
  6. data/lib/bolt/inventory.rb +15 -1
  7. data/lib/bolt/puppetdb.rb +11 -0
  8. data/lib/bolt/puppetdb/client.rb +68 -0
  9. data/lib/bolt/puppetdb/config.rb +76 -0
  10. data/lib/bolt/target.rb +5 -4
  11. data/lib/bolt/transport/base.rb +11 -2
  12. data/lib/bolt/transport/local.rb +11 -5
  13. data/lib/bolt/transport/orch.rb +16 -5
  14. data/lib/bolt/transport/ssh.rb +32 -1
  15. data/lib/bolt/transport/ssh/connection.rb +17 -10
  16. data/lib/bolt/transport/winrm.rb +18 -1
  17. data/lib/bolt/transport/winrm/connection.rb +15 -16
  18. data/lib/bolt/util.rb +15 -0
  19. data/lib/bolt/version.rb +1 -1
  20. data/lib/bolt_ext/puppetdb_inventory.rb +5 -135
  21. data/vendored/facter/lib/facter/ec2/rest.rb +1 -1
  22. data/vendored/hiera/lib/hiera/version.rb +1 -1
  23. data/vendored/puppet/lib/puppet/application/agent.rb +1 -3
  24. data/vendored/puppet/lib/puppet/application/apply.rb +2 -4
  25. data/vendored/puppet/lib/puppet/application/cert.rb +6 -1
  26. data/vendored/puppet/lib/puppet/application/device.rb +100 -13
  27. data/vendored/puppet/lib/puppet/application/facts.rb +5 -0
  28. data/vendored/puppet/lib/puppet/application/lookup.rb +11 -1
  29. data/vendored/puppet/lib/puppet/configurer.rb +17 -4
  30. data/vendored/puppet/lib/puppet/configurer/plugin_handler.rb +1 -1
  31. data/vendored/puppet/lib/puppet/datatypes.rb +1 -1
  32. data/vendored/puppet/lib/puppet/defaults.rb +1 -1
  33. data/vendored/puppet/lib/puppet/environments.rb +2 -2
  34. data/vendored/puppet/lib/puppet/error.rb +6 -3
  35. data/vendored/puppet/lib/puppet/external/dot.rb +0 -7
  36. data/vendored/puppet/lib/puppet/external/nagios/parser.rb +1 -1
  37. data/vendored/puppet/lib/puppet/face/config.rb +41 -8
  38. data/vendored/puppet/lib/puppet/face/epp.rb +30 -5
  39. data/vendored/puppet/lib/puppet/face/facts.rb +49 -0
  40. data/vendored/puppet/lib/puppet/face/help.rb +33 -35
  41. data/vendored/puppet/lib/puppet/face/man.rb +55 -12
  42. data/vendored/puppet/lib/puppet/face/parser.rb +30 -3
  43. data/vendored/puppet/lib/puppet/file_bucket/file.rb +0 -2
  44. data/vendored/puppet/lib/puppet/file_serving/base.rb +10 -10
  45. data/vendored/puppet/lib/puppet/functions.rb +1 -3
  46. data/vendored/puppet/lib/puppet/functions/alert.rb +1 -1
  47. data/vendored/puppet/lib/puppet/functions/all.rb +6 -6
  48. data/vendored/puppet/lib/puppet/functions/annotate.rb +10 -10
  49. data/vendored/puppet/lib/puppet/functions/any.rb +6 -6
  50. data/vendored/puppet/lib/puppet/functions/assert_type.rb +4 -4
  51. data/vendored/puppet/lib/puppet/functions/binary_file.rb +14 -2
  52. data/vendored/puppet/lib/puppet/functions/break.rb +31 -2
  53. data/vendored/puppet/lib/puppet/functions/call.rb +4 -4
  54. data/vendored/puppet/lib/puppet/functions/contain.rb +19 -3
  55. data/vendored/puppet/lib/puppet/functions/convert_to.rb +6 -5
  56. data/vendored/puppet/lib/puppet/functions/crit.rb +1 -1
  57. data/vendored/puppet/lib/puppet/functions/debug.rb +1 -1
  58. data/vendored/puppet/lib/puppet/functions/defined.rb +11 -9
  59. data/vendored/puppet/lib/puppet/functions/dig.rb +26 -2
  60. data/vendored/puppet/lib/puppet/functions/each.rb +8 -8
  61. data/vendored/puppet/lib/puppet/functions/emerg.rb +1 -1
  62. data/vendored/puppet/lib/puppet/functions/empty.rb +79 -0
  63. data/vendored/puppet/lib/puppet/functions/err.rb +1 -1
  64. data/vendored/puppet/lib/puppet/functions/filter.rb +7 -7
  65. data/vendored/puppet/lib/puppet/functions/find_file.rb +15 -1
  66. data/vendored/puppet/lib/puppet/functions/flatten.rb +64 -0
  67. data/vendored/puppet/lib/puppet/functions/hiera.rb +6 -6
  68. data/vendored/puppet/lib/puppet/functions/hiera_array.rb +6 -6
  69. data/vendored/puppet/lib/puppet/functions/hiera_hash.rb +6 -6
  70. data/vendored/puppet/lib/puppet/functions/hiera_include.rb +8 -8
  71. data/vendored/puppet/lib/puppet/functions/include.rb +28 -2
  72. data/vendored/puppet/lib/puppet/functions/info.rb +1 -1
  73. data/vendored/puppet/lib/puppet/functions/inline_epp.rb +2 -2
  74. data/vendored/puppet/lib/puppet/functions/join.rb +56 -0
  75. data/vendored/puppet/lib/puppet/functions/keys.rb +25 -0
  76. data/vendored/puppet/lib/puppet/functions/length.rb +44 -0
  77. data/vendored/puppet/lib/puppet/functions/lest.rb +39 -1
  78. data/vendored/puppet/lib/puppet/functions/map.rb +10 -9
  79. data/vendored/puppet/lib/puppet/functions/match.rb +6 -6
  80. data/vendored/puppet/lib/puppet/functions/new.rb +995 -2
  81. data/vendored/puppet/lib/puppet/functions/next.rb +1 -1
  82. data/vendored/puppet/lib/puppet/functions/notice.rb +1 -1
  83. data/vendored/puppet/lib/puppet/functions/reduce.rb +6 -6
  84. data/vendored/puppet/lib/puppet/functions/regsubst.rb +9 -3
  85. data/vendored/puppet/lib/puppet/functions/require.rb +36 -2
  86. data/vendored/puppet/lib/puppet/functions/return.rb +1 -1
  87. data/vendored/puppet/lib/puppet/functions/reverse_each.rb +71 -2
  88. data/vendored/puppet/lib/puppet/functions/slice.rb +23 -9
  89. data/vendored/puppet/lib/puppet/functions/split.rb +12 -10
  90. data/vendored/puppet/lib/puppet/functions/step.rb +73 -1
  91. data/vendored/puppet/lib/puppet/functions/strftime.rb +176 -2
  92. data/vendored/puppet/lib/puppet/functions/then.rb +65 -2
  93. data/vendored/puppet/lib/puppet/functions/tree_each.rb +19 -19
  94. data/vendored/puppet/lib/puppet/functions/type.rb +42 -1
  95. data/vendored/puppet/lib/puppet/functions/unique.rb +13 -13
  96. data/vendored/puppet/lib/puppet/functions/unwrap.rb +8 -4
  97. data/vendored/puppet/lib/puppet/functions/values.rb +25 -0
  98. data/vendored/puppet/lib/puppet/functions/versioncmp.rb +1 -1
  99. data/vendored/puppet/lib/puppet/functions/warning.rb +1 -1
  100. data/vendored/puppet/lib/puppet/functions/with.rb +6 -4
  101. data/vendored/puppet/lib/puppet/indirector/certificate_status/file.rb +1 -1
  102. data/vendored/puppet/lib/puppet/indirector/facts/facter.rb +1 -3
  103. data/vendored/puppet/lib/puppet/indirector/facts/rest.rb +21 -0
  104. data/vendored/puppet/lib/puppet/indirector/facts/yaml.rb +0 -4
  105. data/vendored/puppet/lib/puppet/indirector/file_content/http.rb +3 -1
  106. data/vendored/puppet/lib/puppet/indirector/indirection.rb +5 -3
  107. data/vendored/puppet/lib/puppet/indirector/request.rb +6 -2
  108. data/vendored/puppet/lib/puppet/module/task.rb +2 -2
  109. data/vendored/puppet/lib/puppet/module_tool/tar/mini.rb +57 -4
  110. data/vendored/puppet/lib/puppet/network/authconfig.rb +1 -1
  111. data/vendored/puppet/lib/puppet/network/http/api/indirected_routes.rb +1 -0
  112. data/vendored/puppet/lib/puppet/network/resolver.rb +1 -2
  113. data/vendored/puppet/lib/puppet/node.rb +4 -3
  114. data/vendored/puppet/lib/puppet/parser/compiler.rb +12 -5
  115. data/vendored/puppet/lib/puppet/parser/compiler/catalog_validator/env_relationship_validator.rb +1 -1
  116. data/vendored/puppet/lib/puppet/parser/functions/fqdn_rand.rb +15 -4
  117. data/vendored/puppet/lib/puppet/parser/functions/new.rb +31 -46
  118. data/vendored/puppet/lib/puppet/parser/parser_factory.rb +1 -1
  119. data/vendored/puppet/lib/puppet/parser/resource.rb +1 -1
  120. data/vendored/puppet/lib/puppet/parser/type_loader.rb +11 -11
  121. data/vendored/puppet/lib/puppet/pops/evaluator/closure.rb +1 -1
  122. data/vendored/puppet/lib/puppet/pops/evaluator/collector_transformer.rb +1 -1
  123. data/vendored/puppet/lib/puppet/pops/evaluator/epp_evaluator.rb +2 -2
  124. data/vendored/puppet/lib/puppet/pops/evaluator/runtime3_resource_support.rb +2 -2
  125. data/vendored/puppet/lib/puppet/pops/evaluator/runtime3_support.rb +5 -2
  126. data/vendored/puppet/lib/puppet/pops/functions/dispatch.rb +1 -1
  127. data/vendored/puppet/lib/puppet/pops/issue_reporter.rb +18 -1
  128. data/vendored/puppet/lib/puppet/pops/issues.rb +6 -3
  129. data/vendored/puppet/lib/puppet/pops/loader/ruby_data_type_instantiator.rb +1 -2
  130. data/vendored/puppet/lib/puppet/pops/loader/ruby_function_instantiator.rb +1 -2
  131. data/vendored/puppet/lib/puppet/pops/loader/task_instantiator.rb +4 -4
  132. data/vendored/puppet/lib/puppet/pops/loader/type_definition_instantiator.rb +4 -1
  133. data/vendored/puppet/lib/puppet/pops/loaders.rb +18 -7
  134. data/vendored/puppet/lib/puppet/pops/lookup/global_data_provider.rb +1 -1
  135. data/vendored/puppet/lib/puppet/pops/model/factory.rb +6 -3
  136. data/vendored/puppet/lib/puppet/pops/model/model_tree_dumper.rb +4 -0
  137. data/vendored/puppet/lib/puppet/pops/model/pn_transformer.rb +400 -0
  138. data/vendored/puppet/lib/puppet/pops/parser/eparser.rb +1 -1
  139. data/vendored/puppet/lib/puppet/pops/parser/heredoc_support.rb +1 -1
  140. data/vendored/puppet/lib/puppet/pops/parser/lexer_support.rb +3 -2
  141. data/vendored/puppet/lib/puppet/pops/parser/locator.rb +0 -2
  142. data/vendored/puppet/lib/puppet/pops/parser/pn_parser.rb +316 -0
  143. data/vendored/puppet/lib/puppet/pops/pcore.rb +17 -17
  144. data/vendored/puppet/lib/puppet/pops/pn.rb +236 -0
  145. data/vendored/puppet/lib/puppet/pops/resource/resource_type_impl.rb +1 -1
  146. data/vendored/puppet/lib/puppet/pops/types/class_loader.rb +6 -3
  147. data/vendored/puppet/lib/puppet/pops/types/implementation_registry.rb +28 -35
  148. data/vendored/puppet/lib/puppet/pops/types/p_object_type.rb +3 -3
  149. data/vendored/puppet/lib/puppet/pops/types/p_timespan_type.rb +2 -2
  150. data/vendored/puppet/lib/puppet/pops/types/p_type_set_type.rb +24 -1
  151. data/vendored/puppet/lib/puppet/pops/types/ruby_generator.rb +3 -4
  152. data/vendored/puppet/lib/puppet/pops/types/type_calculator.rb +1 -1
  153. data/vendored/puppet/lib/puppet/pops/types/type_factory.rb +0 -4
  154. data/vendored/puppet/lib/puppet/pops/types/type_mismatch_describer.rb +1 -1
  155. data/vendored/puppet/lib/puppet/pops/types/type_parser.rb +14 -7
  156. data/vendored/puppet/lib/puppet/pops/types/types.rb +1 -1
  157. data/vendored/puppet/lib/puppet/pops/utils.rb +2 -2
  158. data/vendored/puppet/lib/puppet/pops/validation/checker4_0.rb +6 -2
  159. data/vendored/puppet/lib/puppet/provider/group/groupadd.rb +3 -1
  160. data/vendored/puppet/lib/puppet/provider/group/windows_adsi.rb +4 -7
  161. data/vendored/puppet/lib/puppet/provider/nameservice.rb +3 -3
  162. data/vendored/puppet/lib/puppet/provider/package/dnf.rb +1 -1
  163. data/vendored/puppet/lib/puppet/provider/package/gem.rb +1 -1
  164. data/vendored/puppet/lib/puppet/provider/package/pacman.rb +4 -4
  165. data/vendored/puppet/lib/puppet/provider/package/pip.rb +3 -3
  166. data/vendored/puppet/lib/puppet/provider/package/pkgdmg.rb +3 -3
  167. data/vendored/puppet/lib/puppet/provider/package/pkgutil.rb +2 -2
  168. data/vendored/puppet/lib/puppet/provider/package/portage.rb +9 -9
  169. data/vendored/puppet/lib/puppet/provider/package/zypper.rb +2 -2
  170. data/vendored/puppet/lib/puppet/provider/service/base.rb +1 -1
  171. data/vendored/puppet/lib/puppet/provider/service/smf.rb +3 -2
  172. data/vendored/puppet/lib/puppet/provider/user/useradd.rb +6 -2
  173. data/vendored/puppet/lib/puppet/provider/user/windows_adsi.rb +1 -1
  174. data/vendored/puppet/lib/puppet/provider/zfs/zfs.rb +3 -2
  175. data/vendored/puppet/lib/puppet/reference/configuration.rb +2 -0
  176. data/vendored/puppet/lib/puppet/reference/type.rb +11 -11
  177. data/vendored/puppet/lib/puppet/resource.rb +1 -1
  178. data/vendored/puppet/lib/puppet/resource/capability_finder.rb +2 -2
  179. data/vendored/puppet/lib/puppet/resource/catalog.rb +2 -2
  180. data/vendored/puppet/lib/puppet/resource/status.rb +9 -2
  181. data/vendored/puppet/lib/puppet/resource/type.rb +1 -1
  182. data/vendored/puppet/lib/puppet/settings.rb +31 -19
  183. data/vendored/puppet/lib/puppet/settings/base_setting.rb +5 -0
  184. data/vendored/puppet/lib/puppet/settings/config_file.rb +1 -1
  185. data/vendored/puppet/lib/puppet/settings/ttl_setting.rb +5 -0
  186. data/vendored/puppet/lib/puppet/ssl/certificate_factory.rb +2 -2
  187. data/vendored/puppet/lib/puppet/ssl/certificate_request.rb +0 -2
  188. data/vendored/puppet/lib/puppet/transaction/additional_resource_generator.rb +2 -2
  189. data/vendored/puppet/lib/puppet/transaction/event.rb +1 -1
  190. data/vendored/puppet/lib/puppet/transaction/report.rb +1 -1
  191. data/vendored/puppet/lib/puppet/type.rb +9 -13
  192. data/vendored/puppet/lib/puppet/type/augeas.rb +2 -2
  193. data/vendored/puppet/lib/puppet/type/cron.rb +11 -6
  194. data/vendored/puppet/lib/puppet/type/exec.rb +1 -1
  195. data/vendored/puppet/lib/puppet/type/file.rb +4 -5
  196. data/vendored/puppet/lib/puppet/type/host.rb +1 -1
  197. data/vendored/puppet/lib/puppet/type/k5login.rb +30 -54
  198. data/vendored/puppet/lib/puppet/type/package.rb +3 -3
  199. data/vendored/puppet/lib/puppet/type/schedule.rb +12 -12
  200. data/vendored/puppet/lib/puppet/type/scheduled_task.rb +2 -2
  201. data/vendored/puppet/lib/puppet/type/ssh_authorized_key.rb +5 -5
  202. data/vendored/puppet/lib/puppet/type/sshkey.rb +2 -2
  203. data/vendored/puppet/lib/puppet/type/tidy.rb +9 -2
  204. data/vendored/puppet/lib/puppet/type/user.rb +1 -1
  205. data/vendored/puppet/lib/puppet/type/yumrepo.rb +25 -4
  206. data/vendored/puppet/lib/puppet/type/zfs.rb +4 -0
  207. data/vendored/puppet/lib/puppet/util.rb +0 -4
  208. data/vendored/puppet/lib/puppet/util/backups.rb +1 -1
  209. data/vendored/puppet/lib/puppet/util/http_proxy.rb +4 -2
  210. data/vendored/puppet/lib/puppet/util/inifile.rb +3 -4
  211. data/vendored/puppet/lib/puppet/util/log.rb +2 -5
  212. data/vendored/puppet/lib/puppet/util/network_device/cisco/facts.rb +1 -1
  213. data/vendored/puppet/lib/puppet/util/reference.rb +1 -8
  214. data/vendored/puppet/lib/puppet/util/tagging.rb +1 -1
  215. data/vendored/puppet/lib/puppet/util/warnings.rb +0 -2
  216. data/vendored/puppet/lib/puppet/util/windows/adsi.rb +15 -18
  217. data/vendored/puppet/lib/puppet/util/windows/com.rb +2 -1
  218. data/vendored/puppet/lib/puppet/util/windows/file.rb +2 -2
  219. data/vendored/puppet/lib/puppet/util/windows/principal.rb +7 -6
  220. data/vendored/puppet/lib/puppet/util/windows/sid.rb +60 -7
  221. data/vendored/puppet/lib/puppet/util/windows/taskscheduler.rb +0 -9
  222. data/vendored/puppet/lib/puppet/version.rb +1 -1
  223. data/vendored/puppet/lib/puppet_pal.rb +53 -48
  224. 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
- cmd += check_allow_dup
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
- current_users = Puppet::Util::Windows::ADSI::Group.name_sid_hash(current)
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.name_to_sid_object(user_name)
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.name_to_sid_object(user_name).nil?
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 => ['22', '23', '24', '25', '26']
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 *cmd
212
+ yaourt(*cmd)
213
213
  else
214
- pacman *cmd
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 *cmd
261
+ yaourt(*cmd)
262
262
  else
263
- pacman *cmd
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 *args
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 *args
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 *args
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
- begin
94
- curl *args
95
- Puppet.debug "Success: curl transferred [#{name}] (via: curl #{args.join(" ")})"
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 *[sources.map{|src| [ "-t", src ]}, *args].flatten
155
+ pkguti(*[sources.map{|src| [ "-t", src ]}, *args].flatten)
156
156
  else
157
- pkguti *args.flatten
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 *(self.eix_search_arguments + ['--installed'])
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 *cmd
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 *cmd
92
+ emerge(*cmd)
93
93
  end
94
94
  else
95
- emerge *cmd
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 *([@resource[:name], '--format', output_format])
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 *(['--list-sets'])
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
- 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,"})
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 *(self.class.eix_search_arguments + ['--exact',search_field,search_value])
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 *options
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 *options
141
+ zypper(*options)
142
142
  end
143
143
 
144
144
  end
@@ -22,7 +22,7 @@ Puppet::Type.type(:service).provide :base, :parent => :service do
22
22
  'ps auxwww'
23
23
  else
24
24
  'ps -ef'
25
- end
25
+ end
26
26
  end
27
27
  private :getps
28
28
 
@@ -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
- [command(:svcs), "-l", @resource[:name]]
29
- if $CHILD_STATUS.exitstatus == 1
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
- cmd = [command(property_manages_password_age?(param) ? :localpassword : :localmodify)]
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.name_to_sid_object(group_name)
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 *([:create] + add_properties + [@resource[:name]])
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
- types.sort { |a,b|
53
- a.to_s <=> b.to_s
54
- }.each { |name,type|
52
+ types.sort { |a,b|
53
+ a.to_s <=> b.to_s
54
+ }.each { |name,type|
55
55
 
56
- str << "
56
+ str << "
57
57
 
58
58
  ----------------
59
59
 
60
60
  "
61
61
 
62
- str << markdown_header(name, 3)
63
- str << scrub(type.doc) + "\n\n"
62
+ str << markdown_header(name, 3)
63
+ str << scrub(type.doc) + "\n\n"
64
64
 
65
- # Handle the feature docs.
66
- if featuredocs = type.featuredocs
67
- str << markdown_header("Features", 4)
68
- str << featuredocs
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 = {}
@@ -63,7 +63,7 @@ class Puppet::Resource
63
63
  end
64
64
 
65
65
  if tags = data['tags']
66
- tags.each { |t| tag(t) }
66
+ tag(*tags)
67
67
  end
68
68
 
69
69
  ATTRIBUTES.each do |a|
@@ -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.tag(*self.tags)
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 *STATES
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
- tag(*resource.tags)
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,