puppet 2.7.9 → 2.7.11

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 (187) hide show
  1. data/CHANGELOG +413 -0
  2. data/README_DEVELOPER.md +28 -0
  3. data/conf/redhat/puppet.spec +10 -1
  4. data/conf/solaris/pkginfo +1 -1
  5. data/conf/suse/puppet.spec +7 -4
  6. data/ext/envpuppet.bat +13 -0
  7. data/ext/rack/files/apache2.conf +4 -0
  8. data/install.rb +4 -8
  9. data/lib/puppet.rb +1 -1
  10. data/lib/puppet/agent.rb +7 -0
  11. data/lib/puppet/agent/disabler.rb +27 -0
  12. data/lib/puppet/agent/locker.rb +0 -10
  13. data/lib/puppet/application.rb +3 -0
  14. data/lib/puppet/application/agent.rb +13 -3
  15. data/lib/puppet/application/apply.rb +6 -6
  16. data/lib/puppet/application/cert.rb +5 -5
  17. data/lib/puppet/application/instrumentation_data.rb +4 -0
  18. data/lib/puppet/application/instrumentation_listener.rb +4 -0
  19. data/lib/puppet/application/instrumentation_probe.rb +4 -0
  20. data/lib/puppet/configurer.rb +3 -1
  21. data/lib/puppet/configurer/downloader.rb +4 -2
  22. data/lib/puppet/configurer/fact_handler.rb +0 -21
  23. data/lib/puppet/daemon.rb +3 -4
  24. data/lib/puppet/defaults.rb +2 -2
  25. data/lib/puppet/face/instrumentation_data.rb +28 -0
  26. data/lib/puppet/face/instrumentation_listener.rb +96 -0
  27. data/lib/puppet/face/instrumentation_probe.rb +77 -0
  28. data/lib/puppet/face/module/list.rb +64 -0
  29. data/lib/puppet/face/module/uninstall.rb +50 -0
  30. data/lib/puppet/face/node/clean.rb +1 -4
  31. data/lib/puppet/feature/base.rb +1 -0
  32. data/lib/puppet/file_serving/content.rb +1 -1
  33. data/lib/puppet/indirector/facts/facter.rb +20 -7
  34. data/lib/puppet/indirector/facts/inventory_active_record.rb +14 -11
  35. data/lib/puppet/indirector/indirection.rb +7 -0
  36. data/lib/puppet/indirector/instrumentation_data.rb +3 -0
  37. data/lib/puppet/indirector/instrumentation_data/local.rb +19 -0
  38. data/lib/puppet/indirector/instrumentation_data/rest.rb +5 -0
  39. data/lib/puppet/indirector/instrumentation_listener.rb +3 -0
  40. data/lib/puppet/indirector/instrumentation_listener/local.rb +23 -0
  41. data/lib/puppet/indirector/instrumentation_listener/rest.rb +5 -0
  42. data/lib/puppet/indirector/instrumentation_probe.rb +3 -0
  43. data/lib/puppet/indirector/instrumentation_probe/local.rb +24 -0
  44. data/lib/puppet/indirector/instrumentation_probe/rest.rb +5 -0
  45. data/lib/puppet/indirector/rest.rb +1 -1
  46. data/lib/puppet/module.rb +13 -17
  47. data/lib/puppet/module_tool/applications.rb +1 -0
  48. data/lib/puppet/module_tool/applications/uninstaller.rb +33 -0
  49. data/lib/puppet/module_tool/contents_description.rb +1 -1
  50. data/lib/puppet/network/server.rb +2 -3
  51. data/lib/puppet/node/environment.rb +16 -3
  52. data/lib/puppet/parser/ast/leaf.rb +1 -1
  53. data/lib/puppet/parser/functions/create_resources.rb +1 -1
  54. data/lib/puppet/parser/type_loader.rb +1 -1
  55. data/lib/puppet/property.rb +46 -14
  56. data/lib/puppet/provider.rb +13 -4
  57. data/lib/puppet/provider/augeas/augeas.rb +6 -4
  58. data/lib/puppet/provider/group/pw.rb +24 -10
  59. data/lib/puppet/provider/nameservice/directoryservice.rb +146 -37
  60. data/lib/puppet/provider/package/pip.rb +1 -1
  61. data/lib/puppet/provider/package/yum.rb +1 -2
  62. data/lib/puppet/provider/service/debian.rb +14 -0
  63. data/lib/puppet/provider/service/launchd.rb +1 -1
  64. data/lib/puppet/provider/service/smf.rb +2 -2
  65. data/lib/puppet/provider/user/pw.rb +56 -2
  66. data/lib/puppet/provider/user/user_role_add.rb +32 -22
  67. data/lib/puppet/provider/user/windows_adsi.rb +1 -0
  68. data/lib/puppet/rails/benchmark.rb +1 -1
  69. data/lib/puppet/reports/store.rb +8 -1
  70. data/lib/puppet/resource/catalog.rb +5 -1
  71. data/lib/puppet/simple_graph.rb +11 -14
  72. data/lib/puppet/transaction.rb +10 -4
  73. data/lib/puppet/transaction/report.rb +9 -3
  74. data/lib/puppet/type.rb +19 -7
  75. data/lib/puppet/type/exec.rb +1 -1
  76. data/lib/puppet/type/file.rb +4 -1
  77. data/lib/puppet/type/file/ensure.rb +5 -1
  78. data/lib/puppet/type/file/mode.rb +45 -10
  79. data/lib/puppet/type/file/source.rb +4 -0
  80. data/lib/puppet/type/host.rb +17 -3
  81. data/lib/puppet/type/k5login.rb +3 -2
  82. data/lib/puppet/type/schedule.rb +3 -2
  83. data/lib/puppet/util.rb +83 -27
  84. data/lib/puppet/util/anonymous_filelock.rb +36 -0
  85. data/lib/puppet/util/docs.rb +18 -2
  86. data/lib/puppet/util/instrumentation.rb +173 -0
  87. data/lib/puppet/util/instrumentation/data.rb +34 -0
  88. data/lib/puppet/util/instrumentation/indirection_probe.rb +29 -0
  89. data/lib/puppet/util/instrumentation/instrumentable.rb +143 -0
  90. data/lib/puppet/util/instrumentation/listener.rb +60 -0
  91. data/lib/puppet/util/instrumentation/listeners/log.rb +29 -0
  92. data/lib/puppet/util/instrumentation/listeners/performance.rb +30 -0
  93. data/lib/puppet/util/monkey_patches.rb +8 -0
  94. data/lib/puppet/util/pidlock.rb +21 -25
  95. data/lib/puppet/util/rdoc/parser.rb +2 -2
  96. data/lib/puppet/util/reference.rb +8 -23
  97. data/lib/puppet/util/retryaction.rb +48 -0
  98. data/lib/puppet/util/suidmanager.rb +70 -39
  99. data/lib/puppet/util/symbolic_file_mode.rb +140 -0
  100. data/spec/integration/configurer_spec.rb +5 -0
  101. data/spec/integration/indirector/direct_file_server_spec.rb +1 -1
  102. data/spec/integration/indirector/file_content/file_server_spec.rb +7 -7
  103. data/spec/integration/provider/package_spec.rb +7 -0
  104. data/spec/unit/agent/disabler_spec.rb +60 -0
  105. data/spec/unit/agent/locker_spec.rb +0 -12
  106. data/spec/unit/agent_spec.rb +8 -0
  107. data/spec/unit/application/agent_spec.rb +38 -1
  108. data/spec/unit/application/apply_spec.rb +34 -40
  109. data/spec/unit/application/cert_spec.rb +1 -1
  110. data/spec/unit/application_spec.rb +6 -0
  111. data/spec/unit/configurer/downloader_spec.rb +29 -10
  112. data/spec/unit/configurer/fact_handler_spec.rb +5 -29
  113. data/spec/unit/configurer_spec.rb +8 -8
  114. data/spec/unit/daemon_spec.rb +12 -26
  115. data/spec/unit/face/instrumentation_data.rb +7 -0
  116. data/spec/unit/face/instrumentation_listener.rb +38 -0
  117. data/spec/unit/face/instrumentation_probe.rb +21 -0
  118. data/spec/unit/face/node_spec.rb +111 -111
  119. data/spec/unit/file_serving/content_spec.rb +2 -2
  120. data/spec/unit/indirector/facts/facter_spec.rb +25 -3
  121. data/spec/unit/indirector/facts/inventory_active_record_spec.rb +14 -4
  122. data/spec/unit/indirector/instrumentation_data/local_spec.rb +52 -0
  123. data/spec/unit/indirector/instrumentation_data/rest_spec.rb +11 -0
  124. data/spec/unit/indirector/instrumentation_listener/local_spec.rb +65 -0
  125. data/spec/unit/indirector/instrumentation_listener/rest_spec.rb +11 -0
  126. data/spec/unit/indirector/instrumentation_probe/local_spec.rb +65 -0
  127. data/spec/unit/indirector/instrumentation_probe/rest_spec.rb +11 -0
  128. data/spec/unit/module_spec.rb +39 -125
  129. data/spec/unit/module_tool/uninstaller_spec.rb +44 -0
  130. data/spec/unit/network/server_spec.rb +2 -20
  131. data/spec/unit/node/environment_spec.rb +76 -58
  132. data/spec/unit/parser/ast/asthash_spec.rb +1 -2
  133. data/spec/unit/parser/ast/leaf_spec.rb +16 -0
  134. data/spec/unit/property/keyvalue_spec.rb +5 -2
  135. data/spec/unit/property_spec.rb +260 -159
  136. data/spec/unit/provider/augeas/augeas_spec.rb +2 -2
  137. data/spec/unit/provider/group/pw_spec.rb +81 -0
  138. data/spec/unit/provider/nameservice/directoryservice_spec.rb +102 -0
  139. data/spec/unit/provider/package/pip_spec.rb +7 -0
  140. data/spec/unit/provider/package/yum_spec.rb +45 -1
  141. data/spec/unit/provider/service/debian_spec.rb +15 -0
  142. data/spec/unit/provider/service/launchd_spec.rb +48 -43
  143. data/spec/unit/provider/service/smf_spec.rb +3 -3
  144. data/spec/unit/provider/user/pw_spec.rb +183 -0
  145. data/spec/unit/provider/user/user_role_add_spec.rb +46 -39
  146. data/spec/unit/provider/user/windows_adsi_spec.rb +1 -0
  147. data/spec/unit/provider_spec.rb +32 -0
  148. data/spec/unit/reports/store_spec.rb +19 -1
  149. data/spec/unit/simple_graph_spec.rb +34 -19
  150. data/spec/unit/ssl/certificate_factory_spec.rb +3 -3
  151. data/spec/unit/transaction/report_spec.rb +29 -1
  152. data/spec/unit/transaction_spec.rb +32 -46
  153. data/spec/unit/type/file/mode_spec.rb +1 -1
  154. data/spec/unit/type/file/source_spec.rb +28 -3
  155. data/spec/unit/type/file_spec.rb +17 -16
  156. data/spec/unit/type/host_spec.rb +527 -0
  157. data/spec/unit/type/k5login_spec.rb +115 -0
  158. data/spec/unit/type/schedule_spec.rb +6 -6
  159. data/spec/unit/type_spec.rb +51 -0
  160. data/spec/unit/util/anonymous_filelock_spec.rb +78 -0
  161. data/spec/unit/util/execution_stub_spec.rb +2 -1
  162. data/spec/unit/util/instrumentation/data_spec.rb +44 -0
  163. data/spec/unit/util/instrumentation/indirection_probe_spec.rb +19 -0
  164. data/spec/unit/util/instrumentation/instrumentable_spec.rb +186 -0
  165. data/spec/unit/util/instrumentation/listener_spec.rb +100 -0
  166. data/spec/unit/util/instrumentation/listeners/log_spec.rb +34 -0
  167. data/spec/unit/util/instrumentation/listeners/performance_spec.rb +36 -0
  168. data/spec/unit/util/instrumentation_spec.rb +181 -0
  169. data/spec/unit/util/pidlock_spec.rb +208 -0
  170. data/spec/unit/util/rdoc/parser_spec.rb +1 -1
  171. data/spec/unit/util/reference_spec.rb +16 -6
  172. data/spec/unit/util/retryaction_spec.rb +62 -0
  173. data/spec/unit/util/suidmanager_spec.rb +101 -83
  174. data/spec/unit/util/symbolic_file_mode_spec.rb +182 -0
  175. data/spec/unit/util_spec.rb +126 -0
  176. data/tasks/rake/apple.rake +176 -0
  177. data/tasks/rake/templates/prototype.plist.erb +38 -0
  178. metadata +61 -13
  179. data/lib/puppet/application/module.rb +0 -3
  180. data/lib/puppet/face/module.rb +0 -12
  181. data/spec/unit/face/module/build_spec.rb +0 -30
  182. data/spec/unit/face/module/changes_spec.rb +0 -30
  183. data/spec/unit/face/module/clean_spec.rb +0 -30
  184. data/spec/unit/face/module/generate_spec.rb +0 -30
  185. data/spec/unit/face/module/install_spec.rb +0 -75
  186. data/spec/unit/face/module/search_spec.rb +0 -40
  187. data/test/util/pidlock.rb +0 -126
@@ -5,7 +5,7 @@
5
5
  %global confdir conf/redhat
6
6
 
7
7
  Name: puppet
8
- Version: 2.7.9
8
+ Version: 2.7.10
9
9
  #Release: 0.1rc1%{?dist}
10
10
  Release: 1%{?dist}
11
11
  Summary: A network tool for managing many disparate systems
@@ -285,6 +285,9 @@ fi
285
285
  rm -rf %{buildroot}
286
286
 
287
287
  %changelog
288
+ * Wed Jan 25 2012 Michael Stahnke <stahnma@puppetlabs.com> - 2.7.10-1
289
+ - Update for 2.7.10
290
+
288
291
  * Fri Dec 9 2011 Matthaus Litteken <matthaus@puppetlabs.com> - 2.7.9-1
289
292
  - Update for 2.7.9
290
293
 
@@ -325,6 +328,12 @@ rm -rf %{buildroot}
325
328
  * Wed Jul 06 2011 Michael Stahnke <stahnma@puppetlabs.com> - 2.7.2-0.1.rc1
326
329
  - Update to 2.7.2rc1
327
330
 
331
+ * Mon Dec 12 2011 Matthaus Litteken <matthaus@puppetlabs.com> - 2.6.13-1
332
+ - Release of 2.6.13
333
+
334
+ * Fri Oct 21 2011 Michael Stahnke <stahnma@puppetlabs.com> - 2.6.12-1
335
+ - CVE-2011-3872 fixes
336
+
328
337
  * Wed Jun 15 2011 Todd Zullinger <tmz@pobox.com> - 2.6.9-0.1.rc1
329
338
  - Update rc versioning to ensure 2.6.9 final is newer to rpm
330
339
  - sync changes with Fedora/EPEL
@@ -1,6 +1,6 @@
1
1
  PKG=CSWpuppet
2
2
  NAME=puppet - System Automation Framework
3
- VERSION=2.7.8
3
+ VERSION=2.7.10
4
4
  CATEGORY=application
5
5
  VENDOR=http://projects.puppetlabs.com/projects/puppet
6
6
  EMAIL=info@puppetlabs.com
@@ -4,13 +4,13 @@
4
4
 
5
5
  Summary: A network tool for managing many disparate systems
6
6
  Name: puppet
7
- Version: 2.7.8
8
- Release: 0.1rc1%{?dist}
7
+ Version: 2.7.10
8
+ Release: 1%{?dist}
9
9
  License: Apache 2.0
10
10
  Group: Productivity/Networking/System
11
11
 
12
12
  URL: http://puppetlabs.com/projects/puppet/
13
- Source0: http://puppetlabs.com/downloads/puppet/%{name}-%{version}rc1.tar.gz
13
+ Source0: http://puppetlabs.com/downloads/puppet/%{name}-%{version}.tar.gz
14
14
 
15
15
  PreReq: %{insserv_prereq} %{fillup_prereq}
16
16
  Requires: ruby >= 1.8.2
@@ -35,7 +35,7 @@ Provides the central puppet server daemon which provides manifests to clients.
35
35
  The server can also function as a certificate authority and file server.
36
36
 
37
37
  %prep
38
- %setup -q -n %{name}-%{version}rc1
38
+ %setup -q -n %{name}-%{version}
39
39
 
40
40
  %build
41
41
  for f in bin/* sbin/*; do
@@ -136,6 +136,9 @@ find %{buildroot}%{ruby_sitelibdir} -type f -perm +ugo+x -exec chmod a-x '{}' \;
136
136
  %{__rm} -rf %{buildroot}
137
137
 
138
138
  %changelog
139
+ * Wed Jan 25 2012 Michael Stahnke <stahnma@puppetlabs.com> - 2.7.10-1
140
+ - Update for 2.7.10
141
+
139
142
  * Wed Nov 30 2011 Michael Stahnke <stahnma@puppetlabs.com> - 2.7.8-0.1rc1
140
143
  - Update for 2.7.8rc1
141
144
 
@@ -0,0 +1,13 @@
1
+ @echo off
2
+ SETLOCAL
3
+
4
+ REM net use Z: "\\vmware-host\Shared Folders" /persistent:yes
5
+
6
+ SET PUPPET_DIR=%~dp0..
7
+ SET FACTER_DIR=%PUPPET_DIR%\..\facter
8
+
9
+ SET PATH=%PUPPET_DIR%\bin;%FACTER_DIR%\bin;%PATH%
10
+ SET RUBYLIB=%PUPPET_DIR%\lib;%FACTER_DIR%\lib;%RUBYLIB%
11
+ SET RUBYLIB=%RUBYLIB:\=/%
12
+
13
+ ruby -S %*
@@ -26,6 +26,10 @@ Listen 8140
26
26
  SSLVerifyDepth 1
27
27
  SSLOptions +StdEnvVars
28
28
 
29
+ RequestHeader set X-SSL-Subject %{SSL_CLIENT_S_DN}e
30
+ RequestHeader set X-Client-DN %{SSL_CLIENT_S_DN}e
31
+ RequestHeader set X-Client-Verify %{SSL_CLIENT_VERIFY}e
32
+
29
33
  DocumentRoot /etc/puppet/rack/public/
30
34
  RackBaseURI /
31
35
  <Directory /etc/puppet/rack/>
data/install.rb CHANGED
@@ -422,16 +422,12 @@ def install_binfile(from, op_file, target)
422
422
 
423
423
  if not installed_wrapper
424
424
  tmp_file2 = File.join(tmp_dir, '_tmp_wrapper')
425
- cwn = File.join(Config::CONFIG['bindir'], op_file)
426
425
  cwv = <<-EOS
427
426
  @echo off
428
- if "%OS%"=="Windows_NT" goto WinNT
429
- #{ruby} -x "#{cwn}" %1 %2 %3 %4 %5 %6 %7 %8 %9
430
- goto done
431
- :WinNT
432
- #{ruby} -x "#{cwn}" %*
433
- goto done
434
- :done
427
+ setlocal
428
+ set RUBY_BIN=%~dp0
429
+ set RUBY_BIN=%RUBY_BIN:\\=/%
430
+ "%RUBY_BIN%ruby.exe" -x "%RUBY_BIN%puppet" %*
435
431
  EOS
436
432
  File.open(tmp_file2, "w") { |cw| cw.puts cwv }
437
433
  FileUtils.install(tmp_file2, File.join(target, "#{op_file}.bat"), :mode => 0755, :verbose => true)
@@ -24,7 +24,7 @@ require 'puppet/util/run_mode'
24
24
  # it's also a place to find top-level commands like 'debug'
25
25
 
26
26
  module Puppet
27
- PUPPETVERSION = '2.7.9'
27
+ PUPPETVERSION = '2.7.11'
28
28
 
29
29
  def Puppet.version
30
30
  PUPPETVERSION
@@ -8,6 +8,9 @@ class Puppet::Agent
8
8
  require 'puppet/agent/locker'
9
9
  include Puppet::Agent::Locker
10
10
 
11
+ require 'puppet/agent/disabler'
12
+ include Puppet::Agent::Disabler
13
+
11
14
  attr_reader :client_class, :client, :splayed
12
15
 
13
16
  # Just so we can specify that we are "the" instance.
@@ -31,6 +34,10 @@ class Puppet::Agent
31
34
  Puppet.notice "Run of #{client_class} already in progress; skipping"
32
35
  return
33
36
  end
37
+ if disabled?
38
+ Puppet.notice "Skipping run of #{client_class}; administratively disabled: #{disable_message}"
39
+ return
40
+ end
34
41
  result = nil
35
42
  block_run = Puppet::Application.controlled_run do
36
43
  splay
@@ -0,0 +1,27 @@
1
+ require 'puppet/util/anonymous_filelock'
2
+
3
+ module Puppet::Agent::Disabler
4
+ # Let the daemon run again, freely in the filesystem.
5
+ def enable
6
+ disable_lockfile.unlock
7
+ end
8
+
9
+ # Stop the daemon from making any catalog runs.
10
+ def disable(msg='')
11
+ disable_lockfile.lock(msg)
12
+ end
13
+
14
+ def disable_lockfile
15
+ @disable_lockfile ||= Puppet::Util::AnonymousFilelock.new(lockfile_path+".disabled")
16
+
17
+ @disable_lockfile
18
+ end
19
+
20
+ def disabled?
21
+ disable_lockfile.locked?
22
+ end
23
+
24
+ def disable_message
25
+ disable_lockfile.message
26
+ end
27
+ end
@@ -3,16 +3,6 @@ require 'puppet/util/pidlock'
3
3
  # Break out the code related to locking the agent. This module is just
4
4
  # included into the agent, but having it here makes it easier to test.
5
5
  module Puppet::Agent::Locker
6
- # Let the daemon run again, freely in the filesystem.
7
- def enable
8
- lockfile.unlock(:anonymous => true)
9
- end
10
-
11
- # Stop the daemon from making any catalog runs.
12
- def disable
13
- lockfile.lock(:anonymous => true)
14
- end
15
-
16
6
  # Yield if we get a lock, else do nothing. Return
17
7
  # true/false depending on whether we get the lock.
18
8
  def lock
@@ -263,12 +263,15 @@ class Application
263
263
  end
264
264
 
265
265
  def initialize(command_line = nil)
266
+
266
267
  require 'puppet/util/command_line'
267
268
  @command_line = command_line || Puppet::Util::CommandLine.new
268
269
  set_run_mode self.class.run_mode
269
270
  @options = {}
270
271
 
271
272
  require 'puppet'
273
+ require 'puppet/util/instrumentation'
274
+ Puppet::Util::Instrumentation.init
272
275
  end
273
276
 
274
277
  # WARNING: This is a totally scary, frightening, and nasty internal API. We
@@ -39,7 +39,12 @@ class Puppet::Application::Agent < Puppet::Application
39
39
  end
40
40
 
41
41
  option("--centrallogging")
42
- option("--disable")
42
+
43
+ option("--disable [MESSAGE]") do |message|
44
+ options[:disable] = true
45
+ options[:disable_message] = message
46
+ end
47
+
43
48
  option("--enable")
44
49
  option("--debug","-d")
45
50
  option("--fqdn FQDN","-f")
@@ -101,7 +106,7 @@ similar), or run interactively for testing purposes.
101
106
  USAGE
102
107
  -----
103
108
  puppet agent [--certname <name>] [-D|--daemonize|--no-daemonize]
104
- [-d|--debug] [--detailed-exitcodes] [--digest <digest>] [--disable] [--enable]
109
+ [-d|--debug] [--detailed-exitcodes] [--digest <digest>] [--disable [message]] [--enable]
105
110
  [--fingerprint] [-h|--help] [-l|--logdest syslog|<file>|console]
106
111
  [--no-client] [--noop] [-o|--onetime] [--serve <handler>] [-t|--test]
107
112
  [-v|--verbose] [-V|--version] [-w|--waitforcert <seconds>]
@@ -205,6 +210,9 @@ configuration options can also be generated by running puppet agent with
205
210
  not want the central configuration to override the local state until
206
211
  everything is tested and committed.
207
212
 
213
+ Disable can also take an optional message that will be reported by the
214
+ 'puppet agent' at the next disabled run.
215
+
208
216
  'puppet agent' uses the same lock file while it is running, so no more
209
217
  than one 'puppet agent' process is working at a time.
210
218
 
@@ -339,6 +347,8 @@ Copyright (c) 2011 Puppet Labs, LLC Licensed under the Apache 2.0 License
339
347
  Puppet.err detail.to_s
340
348
  end
341
349
 
350
+ @daemon.stop(:exit => false)
351
+
342
352
  if not report
343
353
  exit(1)
344
354
  elsif options[:detailed_exitcodes] then
@@ -384,7 +394,7 @@ Copyright (c) 2011 Puppet Labs, LLC Licensed under the Apache 2.0 License
384
394
  if options[:enable]
385
395
  agent.enable
386
396
  elsif options[:disable]
387
- agent.disable
397
+ agent.disable(options[:disable_message] || 'reason not specified')
388
398
  end
389
399
  exit(0)
390
400
  end
@@ -182,12 +182,12 @@ Copyright (c) 2011 Puppet Labs, LLC Licensed under the Apache 2.0 License
182
182
  Puppet[:manifest] = manifest
183
183
  end
184
184
 
185
- # Collect our facts.
186
- unless facts = Puppet::Node::Facts.indirection.find(Puppet[:node_name_value])
187
- raise "Could not find facts for #{Puppet[:node_name_value]}"
188
- end
189
-
190
185
  unless Puppet[:node_name_fact].empty?
186
+ # Collect our facts.
187
+ unless facts = Puppet::Node::Facts.indirection.find(Puppet[:node_name_value])
188
+ raise "Could not find facts for #{Puppet[:node_name_value]}"
189
+ end
190
+
191
191
  Puppet[:node_name_value] = facts.values[Puppet[:node_name_fact]]
192
192
  facts.name = Puppet[:node_name_value]
193
193
  end
@@ -198,7 +198,7 @@ Copyright (c) 2011 Puppet Labs, LLC Licensed under the Apache 2.0 License
198
198
  end
199
199
 
200
200
  # Merge in the facts.
201
- node.merge(facts.values)
201
+ node.merge(facts.values) if facts
202
202
 
203
203
  # Allow users to load the classes that puppet agent creates.
204
204
  if options[:loadclasses]
@@ -17,11 +17,11 @@ class Puppet::Application::Cert < Puppet::Application
17
17
  @subcommand = (sub == :clean ? :destroy : sub)
18
18
  end
19
19
 
20
- option("--clean", "-c") do
20
+ option("--clean", "-c") do |arg|
21
21
  self.subcommand = "destroy"
22
22
  end
23
23
 
24
- option("--all", "-a") do
24
+ option("--all", "-a") do |arg|
25
25
  @all = true
26
26
  end
27
27
 
@@ -29,7 +29,7 @@ class Puppet::Application::Cert < Puppet::Application
29
29
  @digest = arg
30
30
  end
31
31
 
32
- option("--signed", "-s") do
32
+ option("--signed", "-s") do |arg|
33
33
  @signed = true
34
34
  end
35
35
 
@@ -39,7 +39,7 @@ class Puppet::Application::Cert < Puppet::Application
39
39
 
40
40
  require 'puppet/ssl/certificate_authority/interface'
41
41
  Puppet::SSL::CertificateAuthority::Interface::INTERFACE_METHODS.reject {|m| m == :destroy }.each do |method|
42
- option("--#{method.to_s.gsub('_','-')}", "-#{method.to_s[0,1]}") do
42
+ option("--#{method.to_s.gsub('_','-')}", "-#{method.to_s[0,1]}") do |arg|
43
43
  self.subcommand = method
44
44
  end
45
45
  end
@@ -48,7 +48,7 @@ class Puppet::Application::Cert < Puppet::Application
48
48
  options[:allow_dns_alt_names] = value
49
49
  end
50
50
 
51
- option("--verbose", "-v") do
51
+ option("--verbose", "-v") do |arg|
52
52
  Puppet::Util::Log.level = :info
53
53
  end
54
54
 
@@ -0,0 +1,4 @@
1
+ require 'puppet/application/indirection_base'
2
+
3
+ class Puppet::Application::Instrumentation_data < Puppet::Application::IndirectionBase
4
+ end
@@ -0,0 +1,4 @@
1
+ require 'puppet/application/indirection_base'
2
+
3
+ class Puppet::Application::Instrumentation_listener < Puppet::Application::IndirectionBase
4
+ end
@@ -0,0 +1,4 @@
1
+ require 'puppet/application/indirection_base'
2
+
3
+ class Puppet::Application::Instrumentation_probe < Puppet::Application::IndirectionBase
4
+ end
@@ -178,7 +178,9 @@ class Puppet::Configurer
178
178
  end
179
179
 
180
180
  def save_last_run_summary(report)
181
- Puppet::Util::FileLocking.writelock(Puppet[:lastrunfile], 0660) do |file|
181
+ mode = Puppet.settings.setting(:lastrunfile).mode
182
+ Puppet::Util::FileLocking.writelock(Puppet[:lastrunfile]) do |file|
183
+ file.chmod(mode)
182
184
  file.print YAML.dump(report.raw_summary)
183
185
  end
184
186
  rescue => detail
@@ -63,14 +63,16 @@ class Puppet::Configurer::Downloader
63
63
 
64
64
  private
65
65
 
66
+ require 'sys/admin' if Puppet.features.microsoft_windows?
67
+
66
68
  def default_arguments
67
69
  {
68
70
  :path => path,
69
71
  :recurse => true,
70
72
  :source => source,
71
73
  :tag => name,
72
- :owner => Process.uid,
73
- :group => Process.gid,
74
+ :owner => Puppet.features.microsoft_windows? ? Sys::Admin.get_login : Process.uid,
75
+ :group => Puppet.features.microsoft_windows? ? 'S-1-0-0' : Process.gid,
74
76
  :purge => true,
75
77
  :force => true,
76
78
  :backup => false,
@@ -15,7 +15,6 @@ module Puppet::Configurer::FactHandler
15
15
  # finding facts and the 'rest' terminus for caching them. Thus, we'll
16
16
  # compile them and then "cache" them on the server.
17
17
  begin
18
- reload_facter
19
18
  facts = Puppet::Node::Facts.indirection.find(Puppet[:node_name_value])
20
19
  unless Puppet[:node_name_fact].empty?
21
20
  Puppet[:node_name_value] = facts.values[Puppet[:node_name_fact]]
@@ -54,24 +53,4 @@ module Puppet::Configurer::FactHandler
54
53
 
55
54
  Puppet::Configurer::Downloader.new("fact", Puppet[:factdest], Puppet[:factsource], Puppet[:factsignore]).evaluate
56
55
  end
57
-
58
- # Clear out all of the loaded facts and reload them from disk.
59
- # NOTE: This is clumsy and shouldn't be required for later (1.5.x) versions
60
- # of Facter.
61
- def reload_facter
62
- Facter.clear
63
-
64
- # Reload everything.
65
- if Facter.respond_to? :loadfacts
66
- Facter.loadfacts
67
- elsif Facter.respond_to? :load
68
- Facter.load
69
- else
70
- Puppet.warning "You should upgrade your version of Facter to at least 1.3.8"
71
- end
72
-
73
- # This loads all existing facts and any new ones. We have to remove and
74
- # reload because there's no way to unload specific facts.
75
- Puppet::Node::Facts::Facter.load_fact_plugins
76
- end
77
56
  end
@@ -33,9 +33,9 @@ class Puppet::Daemon
33
33
  Puppet::Util::Log.reopen
34
34
  rescue => detail
35
35
  Puppet.err "Could not start #{Puppet[:name]}: #{detail}"
36
- Puppet::Util::secure_open("/tmp/daemonout", "w") { |f|
36
+ Puppet::Util::replace_file("/tmp/daemonout", 0644) do |f|
37
37
  f.puts "Could not start #{Puppet[:name]}: #{detail}"
38
- }
38
+ end
39
39
  exit(12)
40
40
  end
41
41
  end
@@ -74,8 +74,7 @@ class Puppet::Daemon
74
74
  # Remove the pid file for our daemon.
75
75
  def remove_pidfile
76
76
  Puppet::Util.synchronize_on(Puppet[:name],Sync::EX) do
77
- locker = Puppet::Util::Pidlock.new(pidfile)
78
- locker.unlock or Puppet.err "Could not remove PID file #{pidfile}" if locker.locked?
77
+ Puppet::Util::Pidlock.new(pidfile).unlock
79
78
  end
80
79
  end
81
80
 
@@ -709,11 +709,11 @@ EOT
709
709
  "Whether to send reports after every transaction."
710
710
  ],
711
711
  :lastrunfile => { :default => "$statedir/last_run_summary.yaml",
712
- :mode => 0660,
712
+ :mode => 0644,
713
713
  :desc => "Where puppet agent stores the last run report summary in yaml format."
714
714
  },
715
715
  :lastrunreport => { :default => "$statedir/last_run_report.yaml",
716
- :mode => 0660,
716
+ :mode => 0644,
717
717
  :desc => "Where puppet agent stores the last run report in yaml format."
718
718
  },
719
719
  :graph => [false, "Whether to create dot graph files for the different