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.
- data/CHANGELOG +413 -0
- data/README_DEVELOPER.md +28 -0
- data/conf/redhat/puppet.spec +10 -1
- data/conf/solaris/pkginfo +1 -1
- data/conf/suse/puppet.spec +7 -4
- data/ext/envpuppet.bat +13 -0
- data/ext/rack/files/apache2.conf +4 -0
- data/install.rb +4 -8
- data/lib/puppet.rb +1 -1
- data/lib/puppet/agent.rb +7 -0
- data/lib/puppet/agent/disabler.rb +27 -0
- data/lib/puppet/agent/locker.rb +0 -10
- data/lib/puppet/application.rb +3 -0
- data/lib/puppet/application/agent.rb +13 -3
- data/lib/puppet/application/apply.rb +6 -6
- data/lib/puppet/application/cert.rb +5 -5
- data/lib/puppet/application/instrumentation_data.rb +4 -0
- data/lib/puppet/application/instrumentation_listener.rb +4 -0
- data/lib/puppet/application/instrumentation_probe.rb +4 -0
- data/lib/puppet/configurer.rb +3 -1
- data/lib/puppet/configurer/downloader.rb +4 -2
- data/lib/puppet/configurer/fact_handler.rb +0 -21
- data/lib/puppet/daemon.rb +3 -4
- data/lib/puppet/defaults.rb +2 -2
- data/lib/puppet/face/instrumentation_data.rb +28 -0
- data/lib/puppet/face/instrumentation_listener.rb +96 -0
- data/lib/puppet/face/instrumentation_probe.rb +77 -0
- data/lib/puppet/face/module/list.rb +64 -0
- data/lib/puppet/face/module/uninstall.rb +50 -0
- data/lib/puppet/face/node/clean.rb +1 -4
- data/lib/puppet/feature/base.rb +1 -0
- data/lib/puppet/file_serving/content.rb +1 -1
- data/lib/puppet/indirector/facts/facter.rb +20 -7
- data/lib/puppet/indirector/facts/inventory_active_record.rb +14 -11
- data/lib/puppet/indirector/indirection.rb +7 -0
- data/lib/puppet/indirector/instrumentation_data.rb +3 -0
- data/lib/puppet/indirector/instrumentation_data/local.rb +19 -0
- data/lib/puppet/indirector/instrumentation_data/rest.rb +5 -0
- data/lib/puppet/indirector/instrumentation_listener.rb +3 -0
- data/lib/puppet/indirector/instrumentation_listener/local.rb +23 -0
- data/lib/puppet/indirector/instrumentation_listener/rest.rb +5 -0
- data/lib/puppet/indirector/instrumentation_probe.rb +3 -0
- data/lib/puppet/indirector/instrumentation_probe/local.rb +24 -0
- data/lib/puppet/indirector/instrumentation_probe/rest.rb +5 -0
- data/lib/puppet/indirector/rest.rb +1 -1
- data/lib/puppet/module.rb +13 -17
- data/lib/puppet/module_tool/applications.rb +1 -0
- data/lib/puppet/module_tool/applications/uninstaller.rb +33 -0
- data/lib/puppet/module_tool/contents_description.rb +1 -1
- data/lib/puppet/network/server.rb +2 -3
- data/lib/puppet/node/environment.rb +16 -3
- data/lib/puppet/parser/ast/leaf.rb +1 -1
- data/lib/puppet/parser/functions/create_resources.rb +1 -1
- data/lib/puppet/parser/type_loader.rb +1 -1
- data/lib/puppet/property.rb +46 -14
- data/lib/puppet/provider.rb +13 -4
- data/lib/puppet/provider/augeas/augeas.rb +6 -4
- data/lib/puppet/provider/group/pw.rb +24 -10
- data/lib/puppet/provider/nameservice/directoryservice.rb +146 -37
- data/lib/puppet/provider/package/pip.rb +1 -1
- data/lib/puppet/provider/package/yum.rb +1 -2
- data/lib/puppet/provider/service/debian.rb +14 -0
- data/lib/puppet/provider/service/launchd.rb +1 -1
- data/lib/puppet/provider/service/smf.rb +2 -2
- data/lib/puppet/provider/user/pw.rb +56 -2
- data/lib/puppet/provider/user/user_role_add.rb +32 -22
- data/lib/puppet/provider/user/windows_adsi.rb +1 -0
- data/lib/puppet/rails/benchmark.rb +1 -1
- data/lib/puppet/reports/store.rb +8 -1
- data/lib/puppet/resource/catalog.rb +5 -1
- data/lib/puppet/simple_graph.rb +11 -14
- data/lib/puppet/transaction.rb +10 -4
- data/lib/puppet/transaction/report.rb +9 -3
- data/lib/puppet/type.rb +19 -7
- data/lib/puppet/type/exec.rb +1 -1
- data/lib/puppet/type/file.rb +4 -1
- data/lib/puppet/type/file/ensure.rb +5 -1
- data/lib/puppet/type/file/mode.rb +45 -10
- data/lib/puppet/type/file/source.rb +4 -0
- data/lib/puppet/type/host.rb +17 -3
- data/lib/puppet/type/k5login.rb +3 -2
- data/lib/puppet/type/schedule.rb +3 -2
- data/lib/puppet/util.rb +83 -27
- data/lib/puppet/util/anonymous_filelock.rb +36 -0
- data/lib/puppet/util/docs.rb +18 -2
- data/lib/puppet/util/instrumentation.rb +173 -0
- data/lib/puppet/util/instrumentation/data.rb +34 -0
- data/lib/puppet/util/instrumentation/indirection_probe.rb +29 -0
- data/lib/puppet/util/instrumentation/instrumentable.rb +143 -0
- data/lib/puppet/util/instrumentation/listener.rb +60 -0
- data/lib/puppet/util/instrumentation/listeners/log.rb +29 -0
- data/lib/puppet/util/instrumentation/listeners/performance.rb +30 -0
- data/lib/puppet/util/monkey_patches.rb +8 -0
- data/lib/puppet/util/pidlock.rb +21 -25
- data/lib/puppet/util/rdoc/parser.rb +2 -2
- data/lib/puppet/util/reference.rb +8 -23
- data/lib/puppet/util/retryaction.rb +48 -0
- data/lib/puppet/util/suidmanager.rb +70 -39
- data/lib/puppet/util/symbolic_file_mode.rb +140 -0
- data/spec/integration/configurer_spec.rb +5 -0
- data/spec/integration/indirector/direct_file_server_spec.rb +1 -1
- data/spec/integration/indirector/file_content/file_server_spec.rb +7 -7
- data/spec/integration/provider/package_spec.rb +7 -0
- data/spec/unit/agent/disabler_spec.rb +60 -0
- data/spec/unit/agent/locker_spec.rb +0 -12
- data/spec/unit/agent_spec.rb +8 -0
- data/spec/unit/application/agent_spec.rb +38 -1
- data/spec/unit/application/apply_spec.rb +34 -40
- data/spec/unit/application/cert_spec.rb +1 -1
- data/spec/unit/application_spec.rb +6 -0
- data/spec/unit/configurer/downloader_spec.rb +29 -10
- data/spec/unit/configurer/fact_handler_spec.rb +5 -29
- data/spec/unit/configurer_spec.rb +8 -8
- data/spec/unit/daemon_spec.rb +12 -26
- data/spec/unit/face/instrumentation_data.rb +7 -0
- data/spec/unit/face/instrumentation_listener.rb +38 -0
- data/spec/unit/face/instrumentation_probe.rb +21 -0
- data/spec/unit/face/node_spec.rb +111 -111
- data/spec/unit/file_serving/content_spec.rb +2 -2
- data/spec/unit/indirector/facts/facter_spec.rb +25 -3
- data/spec/unit/indirector/facts/inventory_active_record_spec.rb +14 -4
- data/spec/unit/indirector/instrumentation_data/local_spec.rb +52 -0
- data/spec/unit/indirector/instrumentation_data/rest_spec.rb +11 -0
- data/spec/unit/indirector/instrumentation_listener/local_spec.rb +65 -0
- data/spec/unit/indirector/instrumentation_listener/rest_spec.rb +11 -0
- data/spec/unit/indirector/instrumentation_probe/local_spec.rb +65 -0
- data/spec/unit/indirector/instrumentation_probe/rest_spec.rb +11 -0
- data/spec/unit/module_spec.rb +39 -125
- data/spec/unit/module_tool/uninstaller_spec.rb +44 -0
- data/spec/unit/network/server_spec.rb +2 -20
- data/spec/unit/node/environment_spec.rb +76 -58
- data/spec/unit/parser/ast/asthash_spec.rb +1 -2
- data/spec/unit/parser/ast/leaf_spec.rb +16 -0
- data/spec/unit/property/keyvalue_spec.rb +5 -2
- data/spec/unit/property_spec.rb +260 -159
- data/spec/unit/provider/augeas/augeas_spec.rb +2 -2
- data/spec/unit/provider/group/pw_spec.rb +81 -0
- data/spec/unit/provider/nameservice/directoryservice_spec.rb +102 -0
- data/spec/unit/provider/package/pip_spec.rb +7 -0
- data/spec/unit/provider/package/yum_spec.rb +45 -1
- data/spec/unit/provider/service/debian_spec.rb +15 -0
- data/spec/unit/provider/service/launchd_spec.rb +48 -43
- data/spec/unit/provider/service/smf_spec.rb +3 -3
- data/spec/unit/provider/user/pw_spec.rb +183 -0
- data/spec/unit/provider/user/user_role_add_spec.rb +46 -39
- data/spec/unit/provider/user/windows_adsi_spec.rb +1 -0
- data/spec/unit/provider_spec.rb +32 -0
- data/spec/unit/reports/store_spec.rb +19 -1
- data/spec/unit/simple_graph_spec.rb +34 -19
- data/spec/unit/ssl/certificate_factory_spec.rb +3 -3
- data/spec/unit/transaction/report_spec.rb +29 -1
- data/spec/unit/transaction_spec.rb +32 -46
- data/spec/unit/type/file/mode_spec.rb +1 -1
- data/spec/unit/type/file/source_spec.rb +28 -3
- data/spec/unit/type/file_spec.rb +17 -16
- data/spec/unit/type/host_spec.rb +527 -0
- data/spec/unit/type/k5login_spec.rb +115 -0
- data/spec/unit/type/schedule_spec.rb +6 -6
- data/spec/unit/type_spec.rb +51 -0
- data/spec/unit/util/anonymous_filelock_spec.rb +78 -0
- data/spec/unit/util/execution_stub_spec.rb +2 -1
- data/spec/unit/util/instrumentation/data_spec.rb +44 -0
- data/spec/unit/util/instrumentation/indirection_probe_spec.rb +19 -0
- data/spec/unit/util/instrumentation/instrumentable_spec.rb +186 -0
- data/spec/unit/util/instrumentation/listener_spec.rb +100 -0
- data/spec/unit/util/instrumentation/listeners/log_spec.rb +34 -0
- data/spec/unit/util/instrumentation/listeners/performance_spec.rb +36 -0
- data/spec/unit/util/instrumentation_spec.rb +181 -0
- data/spec/unit/util/pidlock_spec.rb +208 -0
- data/spec/unit/util/rdoc/parser_spec.rb +1 -1
- data/spec/unit/util/reference_spec.rb +16 -6
- data/spec/unit/util/retryaction_spec.rb +62 -0
- data/spec/unit/util/suidmanager_spec.rb +101 -83
- data/spec/unit/util/symbolic_file_mode_spec.rb +182 -0
- data/spec/unit/util_spec.rb +126 -0
- data/tasks/rake/apple.rake +176 -0
- data/tasks/rake/templates/prototype.plist.erb +38 -0
- metadata +61 -13
- data/lib/puppet/application/module.rb +0 -3
- data/lib/puppet/face/module.rb +0 -12
- data/spec/unit/face/module/build_spec.rb +0 -30
- data/spec/unit/face/module/changes_spec.rb +0 -30
- data/spec/unit/face/module/clean_spec.rb +0 -30
- data/spec/unit/face/module/generate_spec.rb +0 -30
- data/spec/unit/face/module/install_spec.rb +0 -75
- data/spec/unit/face/module/search_spec.rb +0 -40
- data/test/util/pidlock.rb +0 -126
data/conf/redhat/puppet.spec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
%global confdir conf/redhat
|
6
6
|
|
7
7
|
Name: puppet
|
8
|
-
Version: 2.7.
|
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
|
data/conf/solaris/pkginfo
CHANGED
data/conf/suse/puppet.spec
CHANGED
@@ -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
|
-
Release:
|
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}
|
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}
|
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
|
|
data/ext/envpuppet.bat
ADDED
@@ -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 %*
|
data/ext/rack/files/apache2.conf
CHANGED
@@ -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
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
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)
|
data/lib/puppet.rb
CHANGED
data/lib/puppet/agent.rb
CHANGED
@@ -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
|
data/lib/puppet/agent/locker.rb
CHANGED
@@ -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
|
data/lib/puppet/application.rb
CHANGED
@@ -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
|
-
|
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
|
|
data/lib/puppet/configurer.rb
CHANGED
@@ -178,7 +178,9 @@ class Puppet::Configurer
|
|
178
178
|
end
|
179
179
|
|
180
180
|
def save_last_run_summary(report)
|
181
|
-
Puppet
|
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
|
data/lib/puppet/daemon.rb
CHANGED
@@ -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::
|
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
|
-
|
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
|
|
data/lib/puppet/defaults.rb
CHANGED
@@ -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 =>
|
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 =>
|
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
|