puppet 3.0.1 → 3.0.2.rc1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of puppet might be problematic. Click here for more details.

Files changed (97) hide show
  1. data/Gemfile +17 -3
  2. data/Rakefile +7 -5
  3. data/ext/build_defaults.yaml +1 -1
  4. data/ext/debian/puppet.init +33 -34
  5. data/ext/debian/puppet.logrotate +2 -1
  6. data/ext/debian/puppetmaster.init +1 -2
  7. data/ext/suse/client.init +1 -1
  8. data/ext/suse/puppet.spec +3 -0
  9. data/ext/suse/server.init +1 -1
  10. data/ext/windows/service/daemon.rb +1 -1
  11. data/install.rb +32 -53
  12. data/lib/hiera/backend/puppet_backend.rb +6 -5
  13. data/lib/puppet/agent.rb +3 -3
  14. data/lib/puppet/application/agent.rb +1 -2
  15. data/lib/puppet/application/cert.rb +4 -5
  16. data/lib/puppet/application/kick.rb +3 -0
  17. data/lib/puppet/defaults.rb +15 -2
  18. data/lib/puppet/indirector/exec.rb +1 -1
  19. data/lib/puppet/module_tool/skeleton/templates/generator/manifests/init.pp.erb +1 -1
  20. data/lib/puppet/parser/functions/hiera_include.rb +6 -4
  21. data/lib/puppet/parser/lexer.rb +38 -1
  22. data/lib/puppet/parser/relationship.rb +3 -1
  23. data/lib/puppet/provider.rb +1 -1
  24. data/lib/puppet/provider/augeas/augeas.rb +1 -1
  25. data/lib/puppet/provider/file/windows.rb +10 -29
  26. data/lib/puppet/provider/group/ldap.rb +1 -1
  27. data/lib/puppet/provider/group/windows_adsi.rb +1 -1
  28. data/lib/puppet/provider/ldap.rb +5 -1
  29. data/lib/puppet/provider/macauthorization/macauthorization.rb +2 -6
  30. data/lib/puppet/provider/package/dpkg.rb +8 -12
  31. data/lib/puppet/provider/package/macports.rb +2 -2
  32. data/lib/puppet/provider/package/msi.rb +2 -2
  33. data/lib/puppet/provider/package/sun.rb +1 -1
  34. data/lib/puppet/provider/package/windows.rb +2 -2
  35. data/lib/puppet/provider/package/yum.rb +5 -1
  36. data/lib/puppet/provider/scheduled_task/win32_taskscheduler.rb +2 -2
  37. data/lib/puppet/provider/service/freebsd.rb +1 -1
  38. data/lib/puppet/provider/user/directoryservice.rb +603 -65
  39. data/lib/puppet/provider/user/windows_adsi.rb +1 -1
  40. data/lib/puppet/provider/zpool/zpool.rb +1 -1
  41. data/lib/puppet/run.rb +2 -1
  42. data/lib/puppet/settings.rb +9 -5
  43. data/lib/puppet/ssl/certificate_authority.rb +2 -0
  44. data/lib/puppet/transaction.rb +1 -1
  45. data/lib/puppet/type/cron.rb +4 -4
  46. data/lib/puppet/type/exec.rb +10 -5
  47. data/lib/puppet/type/file.rb +1 -1
  48. data/lib/puppet/type/service.rb +3 -2
  49. data/lib/puppet/type/user.rb +24 -2
  50. data/lib/puppet/util.rb +3 -6
  51. data/lib/puppet/util/adsi.rb +3 -9
  52. data/lib/puppet/util/diff.rb +1 -1
  53. data/lib/puppet/util/execution.rb +13 -6
  54. data/lib/puppet/util/feature.rb +3 -1
  55. data/lib/puppet/util/log/destinations.rb +12 -16
  56. data/lib/puppet/util/selinux.rb +18 -2
  57. data/lib/puppet/util/windows.rb +1 -0
  58. data/lib/puppet/util/windows/security.rb +2 -39
  59. data/lib/puppet/util/windows/sid.rb +96 -0
  60. data/lib/puppet/version.rb +1 -1
  61. data/spec/integration/util/windows/security_spec.rb +3 -23
  62. data/spec/unit/agent_spec.rb +7 -3
  63. data/spec/unit/application/agent_spec.rb +13 -5
  64. data/spec/unit/daemon_spec.rb +2 -1
  65. data/spec/unit/hiera/backend/puppet_backend_spec.rb +49 -42
  66. data/spec/unit/indirector/exec_spec.rb +8 -6
  67. data/spec/unit/parser/functions/hiera_include_spec.rb +11 -4
  68. data/spec/unit/parser/lexer_spec.rb +120 -8
  69. data/spec/unit/parser/relationship_spec.rb +24 -0
  70. data/spec/unit/provider/file/windows_spec.rb +29 -29
  71. data/spec/unit/provider/group/windows_adsi_spec.rb +2 -2
  72. data/spec/unit/provider/nameservice/directoryservice_spec.rb +1 -1
  73. data/spec/unit/provider/package/dpkg_spec.rb +2 -2
  74. data/spec/unit/provider/package/macports_spec.rb +6 -5
  75. data/spec/unit/provider/package/msi_spec.rb +1 -1
  76. data/spec/unit/provider/package/pacman_spec.rb +1 -1
  77. data/spec/unit/provider/package/rpm_spec.rb +1 -1
  78. data/spec/unit/provider/package/sun_spec.rb +4 -4
  79. data/spec/unit/provider/package/windows_spec.rb +1 -1
  80. data/spec/unit/provider/scheduled_task/win32_taskscheduler_spec.rb +14 -11
  81. data/spec/unit/provider/user/directoryservice_spec.rb +943 -0
  82. data/spec/unit/provider/user/ldap_spec.rb +22 -8
  83. data/spec/unit/provider/user/windows_adsi_spec.rb +4 -4
  84. data/spec/unit/provider_spec.rb +1 -1
  85. data/spec/unit/run_spec.rb +1 -1
  86. data/spec/unit/settings_spec.rb +16 -0
  87. data/spec/unit/ssl/certificate_authority_spec.rb +24 -0
  88. data/spec/unit/util/adsi_spec.rb +4 -8
  89. data/spec/unit/util/diff_spec.rb +2 -2
  90. data/spec/unit/util/execution_spec.rb +78 -20
  91. data/spec/unit/util/feature_spec.rb +12 -1
  92. data/spec/unit/util/selinux_spec.rb +20 -0
  93. data/spec/unit/util/windows/sid_spec.rb +100 -0
  94. data/spec/unit/util_spec.rb +17 -0
  95. metadata +71 -48
  96. data/Gemfile.lock +0 -44
  97. data/lib/puppet/provider/interface/base.rb +0 -0
data/lib/puppet/agent.rb CHANGED
@@ -10,13 +10,13 @@ class Puppet::Agent
10
10
  require 'puppet/agent/disabler'
11
11
  include Puppet::Agent::Disabler
12
12
 
13
- attr_reader :client_class, :client, :splayed
14
- attr_accessor :should_fork
13
+ attr_reader :client_class, :client, :splayed, :should_fork
15
14
 
16
15
  # Just so we can specify that we are "the" instance.
17
- def initialize(client_class)
16
+ def initialize(client_class, should_fork=true)
18
17
  @splayed = false
19
18
 
19
+ @should_fork = should_fork
20
20
  @client_class = client_class
21
21
  end
22
22
 
@@ -335,7 +335,6 @@ Copyright (c) 2011 Puppet Labs, LLC Licensed under the Apache 2.0 License
335
335
  @daemon.set_signal_traps
336
336
 
337
337
  begin
338
- @agent.should_fork = false
339
338
  exitstatus = @agent.run
340
339
  rescue => detail
341
340
  Puppet.log_exception(detail)
@@ -404,7 +403,7 @@ Copyright (c) 2011 Puppet Labs, LLC Licensed under the Apache 2.0 License
404
403
  # if --no-client is set.
405
404
  require 'puppet/agent'
406
405
  require 'puppet/configurer'
407
- @agent = Puppet::Agent.new(Puppet::Configurer)
406
+ @agent = Puppet::Agent.new(Puppet::Configurer, (not(Puppet[:onetime])))
408
407
 
409
408
  enable_disable_client(@agent) if options[:enable] or options[:disable]
410
409
 
@@ -108,11 +108,10 @@ unless the '--all' option is set.
108
108
  Print the full-text version of a host's certificate.
109
109
 
110
110
  * revoke:
111
- Revoke the certificate of a client. The certificate can be specified
112
- either by its serial number (given as a decimal number or a
113
- hexadecimal number prefixed by '0x') or by its hostname. The
114
- certificate is revoked by adding it to the Certificate Revocation List
115
- given by the 'cacrl' configuration option. Note that the puppet master
111
+ Revoke the certificate of a client. The certificate can be specified either
112
+ by its serial number (given as a hexadecimal number prefixed by '0x') or by its
113
+ hostname. The certificate is revoked by adding it to the Certificate Revocation
114
+ List given by the 'cacrl' configuration option. Note that the puppet master
116
115
  needs to be restarted after revoking certificates.
117
116
 
118
117
  * sign:
@@ -144,6 +144,9 @@ with '--genconfig'.
144
144
  forking for each client to which to connect. The default is 1, meaning
145
145
  serial execution.
146
146
 
147
+ * --puppetport:
148
+ Use the specified TCP port to connect to agents. Defaults to 8139.
149
+
147
150
  * --tag:
148
151
  Specify a tag for selecting the objects to apply. Does not work with
149
152
  the --test option.
@@ -1479,14 +1479,27 @@ database from within the Puppet Master process."
1479
1479
  }
1480
1480
  )
1481
1481
 
1482
- # This doesn't actually work right now.
1483
-
1484
1482
  define_settings(:parser,
1485
1483
  :templatedir => {
1486
1484
  :default => "$vardir/templates",
1487
1485
  :type => :directory,
1488
1486
  :desc => "Where Puppet looks for template files. Can be a list of colon-separated
1489
1487
  directories.",
1488
+ },
1489
+
1490
+ :allow_variables_with_dashes => {
1491
+ :default => false,
1492
+ :desc => <<-'EOT'
1493
+ Permit hyphens (`-`) in variable names and issue deprecation warnings about
1494
+ them. This setting **should always be `false`;** setting it to `true`
1495
+ will cause subtle and wide-ranging bugs. It will be removed in a future version.
1496
+
1497
+ Hyphenated variables caused major problems in the language, but were allowed
1498
+ between Puppet 2.7.3 and 2.7.14. If you used them during this window, we
1499
+ apologize for the inconvenience --- you can temporarily set this to `true`
1500
+ in order to upgrade, and can rename your variables at your leisure. Please
1501
+ revert it to `false` after you have renamed all affected variables.
1502
+ EOT
1490
1503
  }
1491
1504
  )
1492
1505
  define_settings(:puppetdoc,
@@ -16,7 +16,7 @@ class Puppet::Indirector::Exec < Puppet::Indirector::Terminus
16
16
  # Add our name to it.
17
17
  external_command << name
18
18
  begin
19
- output = execute(external_command, :combine => false)
19
+ output = execute(external_command, :failonfail => true, :combine => false)
20
20
  rescue Puppet::ExecutionFailure => detail
21
21
  raise Puppet::Error, "Failed to find #{name} via exec: #{detail}"
22
22
  end
@@ -33,7 +33,7 @@
33
33
  #
34
34
  # === Copyright
35
35
  #
36
- # Copyright 2011 Your name here, unless otherwise noted.
36
+ # Copyright <%= Time.now.year -%> Your name here, unless otherwise noted.
37
37
  #
38
38
  class <%= metadata.name %> {
39
39
 
@@ -2,10 +2,12 @@ module Puppet::Parser::Functions
2
2
  newfunction(:hiera_include) do |*args|
3
3
  require 'hiera_puppet'
4
4
  key, default, override = HieraPuppet.parse_args(args)
5
- answer = HieraPuppet.lookup(key, default, self, override, :array)
6
-
7
- method = Puppet::Parser::Functions.function(:include)
8
- send(method, answer)
5
+ if answer = HieraPuppet.lookup(key, default, self, override, :array)
6
+ method = Puppet::Parser::Functions.function(:include)
7
+ send(method, answer)
8
+ else
9
+ raise Puppet::ParseError, "Could not find data item #{key}"
10
+ end
9
11
  end
10
12
  end
11
13
 
@@ -100,6 +100,11 @@ class Puppet::Parser::Lexer
100
100
  def sort_tokens
101
101
  @string_tokens.sort! { |a, b| b.string.length <=> a.string.length }
102
102
  end
103
+
104
+ # Yield each token name and value in turn.
105
+ def each
106
+ @tokens.each {|name, value| yield name, value }
107
+ end
103
108
  end
104
109
 
105
110
  TOKENS = TokenList.new
@@ -232,10 +237,30 @@ class Puppet::Parser::Lexer
232
237
  end
233
238
  #:startdoc:
234
239
 
240
+ TOKENS.add_token :DOLLAR_VAR_WITH_DASH, %r{\$(?:::)?(?:[-\w]+::)*[-\w]+} do |lexer, value|
241
+ lexer.warn_if_variable_has_hyphen(value)
242
+
243
+ [TOKENS[:VARIABLE], value[1..-1]]
244
+ end
245
+ def (TOKENS[:DOLLAR_VAR_WITH_DASH]).acceptable?(context = {})
246
+ Puppet[:allow_variables_with_dashes]
247
+ end
248
+
235
249
  TOKENS.add_token :DOLLAR_VAR, %r{\$(::)?(\w+::)*\w+} do |lexer, value|
236
250
  [TOKENS[:VARIABLE],value[1..-1]]
237
251
  end
238
252
 
253
+ TOKENS.add_token :VARIABLE_WITH_DASH, %r{(?:::)?(?:[-\w]+::)*[-\w]+} do |lexer, value|
254
+ lexer.warn_if_variable_has_hyphen(value)
255
+
256
+ [TOKENS[:VARIABLE], value]
257
+ end
258
+ #:stopdoc: # Issue #4161
259
+ def (TOKENS[:VARIABLE_WITH_DASH]).acceptable?(context={})
260
+ Puppet[:allow_variables_with_dashes] and TOKENS[:VARIABLE].acceptable?(context)
261
+ end
262
+ #:startdoc:
263
+
239
264
  TOKENS.add_token :VARIABLE, %r{(::)?(\w+::)*\w+}
240
265
  #:stopdoc: # Issue #4161
241
266
  def (TOKENS[:VARIABLE]).acceptable?(context={})
@@ -514,9 +539,15 @@ class Puppet::Parser::Lexer
514
539
  def tokenize_interpolated_string(token_type,preamble='')
515
540
  value,terminator = slurpstring('"$')
516
541
  token_queue << [TOKENS[token_type[terminator]],preamble+value]
542
+ variable_regex = if Puppet[:allow_variables_with_dashes]
543
+ TOKENS[:VARIABLE_WITH_DASH].regex
544
+ else
545
+ TOKENS[:VARIABLE].regex
546
+ end
517
547
  if terminator != '$' or @scanner.scan(/\{/)
518
548
  token_queue.shift
519
- elsif var_name = @scanner.scan(TOKENS[:VARIABLE].regex)
549
+ elsif var_name = @scanner.scan(variable_regex)
550
+ warn_if_variable_has_hyphen(var_name)
520
551
  token_queue << [TOKENS[:VARIABLE],var_name]
521
552
  tokenize_interpolated_string(DQ_continuation_token_types)
522
553
  else
@@ -547,4 +578,10 @@ class Puppet::Parser::Lexer
547
578
  def commentpush
548
579
  @commentstack.push(['', @line])
549
580
  end
581
+
582
+ def warn_if_variable_has_hyphen(var_name)
583
+ if var_name.include?('-')
584
+ Puppet.deprecation_warning("Using `-` in variable names is deprecated at #{file || '<string>'}:#{line}. See http://links.puppetlabs.com/puppet-hyphenated-variable-deprecation")
585
+ end
586
+ end
550
587
  end
@@ -54,7 +54,9 @@ class Puppet::Parser::Relationship
54
54
  raise ArgumentError, "Could not find resource '#{target}' for relationship from '#{source}'"
55
55
  end
56
56
  Puppet.debug "Adding relationship from #{source} to #{target} with '#{param_name}'"
57
- source_resource[param_name] ||= []
57
+ if source_resource[param_name].class != Array
58
+ source_resource[param_name] = [source_resource[param_name]].compact
59
+ end
58
60
  source_resource[param_name] << target
59
61
  end
60
62
  end
@@ -164,7 +164,7 @@ class Puppet::Provider
164
164
  @confiner.confine :exists => @path, :for_binary => true
165
165
  end
166
166
 
167
- Puppet::Provider::Command.new(@name, @path, Puppet::Util, Puppet::Util::Execution, { :custom_environment => @custom_environment })
167
+ Puppet::Provider::Command.new(@name, @path, Puppet::Util, Puppet::Util::Execution, { :failonfail => true, :combine => true, :custom_environment => @custom_environment })
168
168
  end
169
169
  end
170
170
 
@@ -24,7 +24,7 @@ Puppet::Type.type(:augeas).provide(:augeas) do
24
24
  include Puppet::Util::Diff
25
25
  include Puppet::Util::Package
26
26
 
27
- confine :true => Puppet.features.augeas?
27
+ confine :feature => :augeas
28
28
 
29
29
  has_features :parse_commands, :need_to_run?,:execute_changes
30
30
 
@@ -11,38 +11,19 @@ Puppet::Type.type(:file).provide :windows do
11
11
  include Puppet::Util::Windows::Security
12
12
  end
13
13
 
14
- ERROR_INVALID_SID_STRUCTURE = 1337
15
-
16
- def id2name(id)
17
- # If it's a valid sid, get the name. Otherwise, it's already a name, so
18
- # just return it.
19
- begin
20
- if string_to_sid_ptr(id)
21
- name = nil
22
- Puppet::Util::ADSI.execquery(
23
- "SELECT Name FROM Win32_Account WHERE SID = '#{id}'
24
- AND LocalAccount = true"
25
- ).each { |a| name ||= a.name }
26
- return name
27
- end
28
- rescue Puppet::Util::Windows::Error => e
29
- raise unless e.code == ERROR_INVALID_SID_STRUCTURE
30
- end
31
-
32
- id
33
- end
34
-
35
14
  # Determine if the account is valid, and if so, return the UID
36
15
  def name2id(value)
37
- # If it's a valid sid, then return it. Else, it's a name we need to convert
38
- # to sid.
39
- begin
40
- return value if string_to_sid_ptr(value)
41
- rescue Puppet::Util::Windows::Error => e
42
- raise unless e.code == ERROR_INVALID_SID_STRUCTURE
43
- end
16
+ Puppet::Util::Windows::Security.name_to_sid(value)
17
+ end
44
18
 
45
- Puppet::Util::ADSI.sid_for_account(value) rescue nil
19
+ # If it's a valid SID, get the name. Otherwise, it's already a name,
20
+ # so just return it.
21
+ def id2name(id)
22
+ if Puppet::Util::Windows::Security.valid_sid?(id)
23
+ Puppet::Util::Windows::Security.sid_to_name(id)
24
+ else
25
+ id
26
+ end
46
27
  end
47
28
 
48
29
  # We use users and groups interchangeably, so use the same methods for both
@@ -12,7 +12,7 @@ Puppet::Type.type(:group).provide :ldap, :parent => Puppet::Provider::Ldap do
12
12
  not specify one, but it is a potentially expensive operation, as it
13
13
  iterates across all existing groups to pick the appropriate next one."
14
14
 
15
- confine :true => Puppet.features.ldap?, :false => (Puppet[:ldapuser] == "")
15
+ confine :feature => :ldap, :false => (Puppet[:ldapuser] == "")
16
16
 
17
17
  # We're mapping 'members' here because we want to make it
18
18
  # easy for the ldap user provider to manage groups. This
@@ -41,7 +41,7 @@ Puppet::Type.type(:group).provide :windows_adsi do
41
41
  end
42
42
 
43
43
  def gid
44
- Puppet::Util::ADSI.sid_for_account(@resource[:name])
44
+ Puppet::Util::Windows::Security.name_to_sid(@resource[:name])
45
45
  end
46
46
 
47
47
  def gid=(value)
@@ -46,7 +46,11 @@ class Puppet::Provider::Ldap < Puppet::Provider
46
46
  @property_hash[:ensure] = :present
47
47
  self.class.resource_type.validproperties.each do |property|
48
48
  if val = resource.should(property)
49
- @property_hash[property] = val
49
+ if property.to_s == 'gid'
50
+ self.gid = val
51
+ else
52
+ @property_hash[property] = val
53
+ end
50
54
  end
51
55
  end
52
56
  end
@@ -155,7 +155,7 @@ Puppet::Type.type(:macauthorization).provide :macauthorization, :parent => Puppe
155
155
  # paranoid given the low cost of quering the db once more.
156
156
  cmds = []
157
157
  cmds << :security << "authorizationdb" << "read" << resource[:name]
158
- output = execute(cmds, :combine => false)
158
+ output = execute(cmds, :failonfail => false, :combine => false)
159
159
  current_values = Plist::parse_xml(output)
160
160
  current_values ||= {}
161
161
  specified_values = convert_plist_to_native_attributes(@property_hash)
@@ -186,11 +186,7 @@ Puppet::Type.type(:macauthorization).provide :macauthorization, :parent => Puppe
186
186
  Plist::Emit.save_plist(values, tmp.path)
187
187
  cmds = []
188
188
  cmds << :security << "authorizationdb" << "write" << name
189
-
190
- output = execute(
191
- cmds, :combine => false,
192
-
193
- :stdinfile => tmp.path.to_s)
189
+ output = execute(cmds, :failonfail => false, :combine => false, :stdinfile => tmp.path.to_s)
194
190
  rescue Errno::EACCES => e
195
191
  raise Puppet::Error.new("Cannot save right to #{tmp.path}: #{e}")
196
192
  ensure
@@ -134,22 +134,18 @@ Puppet::Type.type(:package).provide :dpkg, :parent => Puppet::Provider::Package
134
134
 
135
135
  def hold
136
136
  self.install
137
- begin
138
- Tempfile.open('puppet_dpkg_set_selection') { |tmpfile|
139
- tmpfile.write("#{@resource[:name]} hold\n")
140
- tmpfile.flush
141
- execute([:dpkg, "--set-selections"], :stdinfile => tmpfile.path.to_s)
142
- }
137
+ Tempfile.open('puppet_dpkg_set_selection') do |tmpfile|
138
+ tmpfile.write("#{@resource[:name]} hold\n")
139
+ tmpfile.flush
140
+ execute([:dpkg, "--set-selections"], :failonfail => false, :combine => false, :stdinfile => tmpfile.path.to_s)
143
141
  end
144
142
  end
145
143
 
146
144
  def unhold
147
- begin
148
- Tempfile.open('puppet_dpkg_set_selection') { |tmpfile|
149
- tmpfile.write("#{@resource[:name]} install\n")
150
- tmpfile.flush
151
- execute([:dpkg, "--set-selections"], :stdinfile => tmpfile.path.to_s)
152
- }
145
+ Tempfile.open('puppet_dpkg_set_selection') do |tmpfile|
146
+ tmpfile.write("#{@resource[:name]} install\n")
147
+ tmpfile.flush
148
+ execute([:dpkg, "--set-selections"], :failonfail => false, :combine => false, :stdinfile => tmpfile.path.to_s)
153
149
  end
154
150
  end
155
151
  end
@@ -70,7 +70,7 @@ Puppet::Type.type(:package).provide :macports, :parent => Puppet::Provider::Pack
70
70
  end
71
71
 
72
72
  def query
73
- result = self.class.parse_installed_query_line(execute([command(:port), "-q", :installed, @resource[:name]], :combine => false))
73
+ result = self.class.parse_installed_query_line(execute([command(:port), "-q", :installed, @resource[:name]], :failonfail => false, :combine => false))
74
74
  return {} if result.nil?
75
75
  return result
76
76
  end
@@ -79,7 +79,7 @@ Puppet::Type.type(:package).provide :macports, :parent => Puppet::Provider::Pack
79
79
  # We need both the version and the revision to be confident
80
80
  # we've got the latest revision of a specific version
81
81
  # Note we're still not doing anything with variants here.
82
- info_line = execute([command(:port), "-q", :info, "--line", "--version", "--revision", @resource[:name]], :combine => false)
82
+ info_line = execute([command(:port), "-q", :info, "--line", "--version", "--revision", @resource[:name]], :failonfail => false, :combine => false)
83
83
  return nil if info_line == ""
84
84
 
85
85
  if newest = self.class.parse_info_query_line(info_line)
@@ -74,7 +74,7 @@ Puppet::Type.type(:package).provide(:msi, :parent => Puppet::Provider::Package)
74
74
  # because of the special quoting we need to do around the MSI
75
75
  # properties to use.
76
76
  command = ['msiexec.exe', '/qn', '/norestart', '/i', shell_quote(resource[:source]), install_options].flatten.compact.join(' ')
77
- execute(command, :combine => true)
77
+ execute(command, :failonfail => false, :combine => true)
78
78
 
79
79
  check_result(exit_status)
80
80
  end
@@ -83,7 +83,7 @@ Puppet::Type.type(:package).provide(:msi, :parent => Puppet::Provider::Package)
83
83
  fail("The productcode property is missing.") unless properties[:productcode]
84
84
 
85
85
  command = ['msiexec.exe', '/qn', '/norestart', '/x', properties[:productcode], uninstall_options].flatten.compact.join(' ')
86
- execute(command, :combine => true)
86
+ execute(command, :failonfail => false, :combine => true)
87
87
 
88
88
  check_result(exit_status)
89
89
  end
@@ -61,7 +61,7 @@ Puppet::Type.type(:package).provide :sun, :parent => Puppet::Provider::Package d
61
61
  cmd = [command(:pkginfo), '-l']
62
62
  cmd << '-d' << device if device
63
63
  cmd << @resource[:name]
64
- pkgs = self.class.parse_pkginfo(execute(cmd, :failonfail => false))
64
+ pkgs = self.class.parse_pkginfo(execute(cmd, :failonfail => false, :combine => false))
65
65
  errmsg = case pkgs.size
66
66
  when 0; 'No message'
67
67
  when 1; pkgs[0]['ERROR']
@@ -59,14 +59,14 @@ Puppet::Type.type(:package).provide(:windows, :parent => Puppet::Provider::Packa
59
59
  installer = Puppet::Provider::Package::Windows::Package.installer_class(resource)
60
60
 
61
61
  command = [installer.install_command(resource), install_options].flatten.compact.join(' ')
62
- execute(command, {:combine => true})
62
+ execute(command, :failonfail => false, :combine => true)
63
63
 
64
64
  check_result(exit_status)
65
65
  end
66
66
 
67
67
  def uninstall
68
68
  command = [package.uninstall_command, uninstall_options].flatten.compact.join(' ')
69
- execute(command, {:combine => true})
69
+ execute(command, :failonfail => false, :combine => true)
70
70
 
71
71
  check_result(exit_status)
72
72
  end
@@ -1,7 +1,11 @@
1
1
  require 'puppet/util/package'
2
2
 
3
3
  Puppet::Type.type(:package).provide :yum, :parent => :rpm, :source => :rpm do
4
- desc "Support via `yum`."
4
+ desc "Support via `yum`.
5
+
6
+ Using this provider's `uninstallable` feature will not remove dependent packages. To
7
+ remove dependent packages with this provider use the `purgeable` feature, but note this
8
+ feature is destructive and should be used with the utmost care."
5
9
 
6
10
  has_feature :versionable
7
11