puppet 0.25.4 → 0.25.5
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 +679 -23
- data/LICENSE +2 -2
- data/README +2 -2
- data/README.queueing +1 -1
- data/README.rst +2 -2
- data/Rakefile +4 -2
- data/bin/filebucket +2 -2
- data/bin/pi +1 -1
- data/bin/puppet +2 -2
- data/bin/puppetca +2 -2
- data/bin/puppetd +5 -4
- data/bin/puppetdoc +4 -4
- data/bin/puppetmasterd +2 -2
- data/bin/puppetqd +2 -2
- data/bin/puppetrun +2 -2
- data/bin/ralsh +2 -2
- data/conf/epm.list +2 -2
- data/conf/gentoo/puppet/puppet.conf +0 -4
- data/conf/osx/PackageInfo.plist +1 -1
- data/conf/redhat/logrotate +1 -0
- data/conf/redhat/puppet.conf +0 -4
- data/conf/redhat/puppet.spec +16 -10
- data/conf/solaris/pkginfo +2 -2
- data/conf/solaris/smf/puppetd.xml +3 -3
- data/conf/solaris/smf/puppetmasterd.xml +3 -3
- data/conf/solaris/smf/svc-puppetd +1 -1
- data/conf/solaris/smf/svc-puppetmasterd +1 -1
- data/conf/suse/puppet.spec +16 -14
- data/conf/suse/puppet.suse.patch +16 -0
- data/examples/etc/puppet/fileserver.conf +5 -5
- data/examples/modules/sample-module/README.txt +3 -3
- data/examples/modules/sample-module/lib/puppet/parser/functions/hostname_to_dn.rb +1 -1
- data/ext/extlookup.rb +1 -1
- data/ext/nagios/check_puppet.rb +1 -1
- data/ext/nagios/naggen +2 -2
- data/ext/puppet-test +2 -2
- data/ext/puppetlast +1 -1
- data/ext/puppetstoredconfigclean.rb +1 -1
- data/ext/regexp_nodes/regexp_nodes.rb +4 -4
- data/ext/vim/syntax/puppet.vim +5 -3
- data/install.rb +11 -9
- data/lib/puppet.rb +1 -1
- data/lib/puppet/application/puppetd.rb +5 -4
- data/lib/puppet/configurer.rb +38 -31
- data/lib/puppet/defaults.rb +18 -13
- data/lib/puppet/file_serving/fileset.rb +2 -2
- data/lib/puppet/file_serving/terminus_helper.rb +1 -0
- data/lib/puppet/indirector/indirection.rb +20 -13
- data/lib/puppet/network/authstore.rb +3 -3
- data/lib/puppet/network/format_handler.rb +1 -1
- data/lib/puppet/network/handler/fileserver.rb +2 -2
- data/lib/puppet/network/handler/master.rb +1 -1
- data/lib/puppet/network/http_pool.rb +0 -2
- data/lib/puppet/network/http_server/webrick.rb +1 -1
- data/lib/puppet/parser/ast/casestatement.rb +4 -4
- data/lib/puppet/parser/ast/ifstatement.rb +2 -1
- data/lib/puppet/parser/ast/leaf.rb +1 -0
- data/lib/puppet/parser/ast/selector.rb +2 -3
- data/lib/puppet/parser/functions/generate.rb +3 -5
- data/lib/puppet/parser/functions/require.rb +8 -1
- data/lib/puppet/parser/functions/template.rb +1 -1
- data/lib/puppet/parser/lexer.rb +1 -7
- data/lib/puppet/parser/resource.rb +10 -4
- data/lib/puppet/parser/scope.rb +61 -9
- data/lib/puppet/provider/augeas/augeas.rb +23 -7
- data/lib/puppet/provider/macauthorization/macauthorization.rb +1 -1
- data/lib/puppet/provider/maillist/mailman.rb +2 -2
- data/lib/puppet/provider/package/portage.rb +2 -2
- data/lib/puppet/provider/service/debian.rb +2 -2
- data/lib/puppet/provider/service/redhat.rb +1 -1
- data/lib/puppet/provider/service/smf.rb +4 -1
- data/lib/puppet/provider/ssh_authorized_key/parsed.rb +9 -29
- data/lib/puppet/provider/user/user_role_add.rb +1 -1
- data/lib/puppet/reference/configuration.rb +1 -1
- data/lib/puppet/reference/providers.rb +1 -1
- data/lib/puppet/reports/tagmail.rb +1 -0
- data/lib/puppet/resource/catalog.rb +1 -8
- data/lib/puppet/simple_graph.rb +37 -12
- data/lib/puppet/ssl/certificate.rb +2 -3
- data/lib/puppet/ssl/certificate_authority.rb +1 -1
- data/lib/puppet/ssl/host.rb +19 -12
- data/lib/puppet/sslcertificates/ca.rb +5 -6
- data/lib/puppet/transaction.rb +11 -15
- data/lib/puppet/type/augeas.rb +2 -1
- data/lib/puppet/type/exec.rb +1 -1
- data/lib/puppet/type/file.rb +9 -2
- data/lib/puppet/type/file/checksum.rb +2 -1
- data/lib/puppet/type/file/source.rb +4 -4
- data/lib/puppet/type/maillist.rb +10 -0
- data/lib/puppet/type/mount.rb +5 -3
- data/lib/puppet/type/tidy.rb +36 -30
- data/lib/puppet/util/autoload.rb +2 -2
- data/lib/puppet/util/checksums.rb +5 -0
- data/lib/puppet/util/monkey_patches.rb +38 -0
- data/lib/puppet/util/nagios_maker.rb +1 -1
- data/lib/puppet/util/settings.rb +14 -4
- data/lib/puppet/util/suidmanager.rb +26 -2
- data/lib/puppet/util/zaml.rb +318 -0
- data/man/{man8/puppet.conf.8 → man5/puppet.conf.5} +594 -899
- data/man/man8/filebucket.8 +31 -45
- data/man/man8/pi.8 +16 -22
- data/man/man8/puppet.8 +26 -36
- data/man/man8/puppetca.8 +38 -51
- data/man/man8/puppetd.8 +48 -64
- data/man/man8/puppetdoc.8 +37 -48
- data/man/man8/puppetmasterd.8 +24 -32
- data/man/man8/puppetqd.8 +22 -27
- data/man/man8/puppetrun.8 +46 -58
- data/man/man8/ralsh.8 +43 -48
- data/spec/integration/bin/puppetmasterd.rb +20 -9
- data/spec/integration/defaults.rb +4 -0
- data/spec/integration/indirector/certificate/rest.rb +0 -1
- data/spec/integration/indirector/certificate_request/rest.rb +0 -1
- data/spec/integration/indirector/certificate_revocation_list/rest.rb +0 -1
- data/spec/integration/indirector/report/rest.rb +0 -1
- data/spec/integration/indirector/rest.rb +0 -1
- data/spec/integration/parser/functions/require.rb +18 -1
- data/spec/unit/application/filebucket.rb +2 -2
- data/spec/unit/application/puppetd.rb +4 -5
- data/spec/unit/configurer.rb +46 -8
- data/spec/unit/file_serving/fileset.rb +6 -0
- data/spec/unit/file_serving/terminus_helper.rb +10 -0
- data/spec/unit/indirector/indirection.rb +17 -28
- data/spec/unit/network/format_handler.rb +3 -2
- data/spec/unit/network/http_pool.rb +9 -17
- data/spec/unit/parser/ast/casestatement.rb +4 -12
- data/spec/unit/parser/ast/ifstatement.rb +2 -1
- data/spec/unit/parser/ast/leaf.rb +15 -2
- data/spec/unit/parser/ast/selector.rb +4 -12
- data/spec/unit/parser/functions/generate.rb +41 -0
- data/spec/unit/parser/functions/require.rb +23 -2
- data/spec/unit/parser/resource.rb +18 -0
- data/spec/unit/parser/scope.rb +94 -3
- data/spec/unit/provider/augeas/augeas.rb +27 -3
- data/spec/unit/provider/ssh_authorized_key/parsed.rb +30 -19
- data/spec/unit/resource/catalog.rb +16 -39
- data/spec/unit/simple_graph.rb +14 -0
- data/spec/unit/ssl/host.rb +55 -17
- data/spec/unit/type/file.rb +43 -11
- data/spec/unit/type/file/checksum.rb +28 -0
- data/spec/unit/type/tidy.rb +30 -1
- data/spec/unit/util/autoload.rb +2 -1
- data/spec/unit/util/checksums.rb +7 -1
- data/spec/unit/util/settings.rb +39 -2
- data/spec/unit/util/zaml.rb +38 -0
- data/tasks/rake/changelog.rake +1 -1
- data/tasks/rake/gem.rake +3 -3
- data/tasks/rake/git_workflow.rake +1 -1
- data/tasks/rake/sign.rake +1 -1
- data/tasks/rake/yard.rake +11 -0
- data/test/certmgr/certmgr.rb +1 -1
- data/test/data/providers/ssh_authorized_key/parsed/authorized_keys +1 -1
- data/test/lib/puppettest/support/utils.rb +2 -1
- data/test/network/handler/ca.rb +4 -4
- data/test/network/handler/fileserver.rb +15 -9
- data/test/other/transactions.rb +1 -6
- data/test/puppet/tc_suidmanager.rb +7 -2
- data/test/ral/providers/host/parsed.rb +6 -6
- data/test/ral/providers/package.rb +4 -0
- data/test/ral/providers/sshkey/parsed.rb +5 -5
- data/test/ral/type/file.rb +0 -21
- data/test/ral/type/host.rb +4 -4
- data/test/ral/type/resources.rb +0 -78
- data/test/ral/type/sshkey.rb +2 -2
- data/test/test +1 -1
- data/test/util/settings.rb +6 -6
- metadata +1065 -1050
- data/test/executables/puppetmodule.rb +0 -55
- data/test/ral/providers/service/debian.rb +0 -58
data/conf/suse/puppet.spec
CHANGED
@@ -5,21 +5,18 @@
|
|
5
5
|
|
6
6
|
Summary: A network tool for managing many disparate systems
|
7
7
|
Name: puppet
|
8
|
-
Version: 0.
|
9
|
-
Release:
|
8
|
+
Version: 0.25.4
|
9
|
+
Release: 1%{?dist}
|
10
10
|
License: GPL
|
11
11
|
Group: System Environment/Base
|
12
12
|
|
13
|
-
URL: http://
|
14
|
-
Source: http://
|
13
|
+
URL: http://puppetlabs.com/projects/puppet/
|
14
|
+
Source: http://puppetlabs.com/downloads/puppet/%{name}-%{version}.tar.gz
|
15
15
|
Patch0: puppet.suse.patch
|
16
|
-
|
17
|
-
|
18
|
-
Requires: ruby >= 1.8.6
|
16
|
+
Requires: ruby >= 1.8.2
|
19
17
|
Requires: facter >= 1.3.7
|
20
18
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
21
|
-
|
22
|
-
BuildRequires: ruby >= 1.8.6
|
19
|
+
BuildRequires: ruby >= 1.8.2
|
23
20
|
|
24
21
|
%description
|
25
22
|
Puppet lets you centrally manage every important aspect of your system using a
|
@@ -38,8 +35,7 @@ The server can also function as a certificate authority and file server.
|
|
38
35
|
|
39
36
|
%prep
|
40
37
|
%setup -q
|
41
|
-
%patch0 -
|
42
|
-
%patch1 -p1
|
38
|
+
%patch0 -p0
|
43
39
|
|
44
40
|
%build
|
45
41
|
for f in bin/* ; do
|
@@ -56,9 +52,11 @@ done
|
|
56
52
|
%{__install} -d -m0755 %{buildroot}%{_localstatedir}/lib/puppet
|
57
53
|
%{__install} -d -m0755 %{buildroot}%{_localstatedir}/run/puppet
|
58
54
|
%{__install} -d -m0755 %{buildroot}%{_localstatedir}/log/puppet
|
59
|
-
%{__install} -Dp -m0755 %{pbuild}/bin/* %{buildroot}%{_sbindir}
|
55
|
+
%{__install} -Dp -m0755 %{pbuild}/bin/* %{pbuild}/sbin/* %{buildroot}%{_sbindir}
|
60
56
|
%{__mv} %{buildroot}%{_sbindir}/puppet %{buildroot}%{_bindir}/puppet
|
61
57
|
%{__mv} %{buildroot}%{_sbindir}/puppetrun %{buildroot}%{_bindir}/puppetrun
|
58
|
+
%{__mv} %{buildroot}%{_sbindir}/pi %{buildroot}%{_bindir}/pi
|
59
|
+
%{__mv} %{buildroot}%{_sbindir}/filebucket %{buildroot}%{_bindir}/filebucket
|
62
60
|
%{__install} -Dp -m0644 %{pbuild}/lib/puppet.rb %{buildroot}%{ruby_sitelibdir}/puppet.rb
|
63
61
|
%{__cp} -a %{pbuild}/lib/puppet %{buildroot}%{ruby_sitelibdir}
|
64
62
|
find %{buildroot}%{ruby_sitelibdir} -type f -perm +ugo+x -print0 | xargs -0 -r %{__chmod} a-x
|
@@ -73,12 +71,15 @@ find %{buildroot}%{ruby_sitelibdir} -type f -perm +ugo+x -print0 | xargs -0 -r %
|
|
73
71
|
%files
|
74
72
|
%defattr(-, root, root, 0755)
|
75
73
|
%{_bindir}/puppet
|
74
|
+
%{_bindir}/pi
|
75
|
+
%{_bindir}/filebucket
|
76
|
+
%{_sbindir}/ralsh
|
76
77
|
%{_sbindir}/puppetd
|
77
78
|
%{ruby_sitelibdir}/*
|
78
79
|
%{_initrddir}/puppet
|
79
80
|
%config(noreplace) %{_sysconfdir}/sysconfig/puppet
|
80
81
|
%config(noreplace) %{_sysconfdir}/puppet/puppet.conf
|
81
|
-
%doc CHANGELOG COPYING LICENSE README
|
82
|
+
%doc CHANGELOG COPYING LICENSE README examples
|
82
83
|
%exclude %{_sbindir}/puppetdoc
|
83
84
|
%config(noreplace) %{_sysconfdir}/logrotate.d/puppet
|
84
85
|
# These need to be owned by puppet so the server can
|
@@ -90,6 +91,7 @@ find %{buildroot}%{ruby_sitelibdir} -type f -perm +ugo+x -print0 | xargs -0 -r %
|
|
90
91
|
%files server
|
91
92
|
%defattr(-, root, root, 0755)
|
92
93
|
%{_sbindir}/puppetmasterd
|
94
|
+
%{_sbindir}/puppetqd
|
93
95
|
%{_bindir}/puppetrun
|
94
96
|
%{_initrddir}/puppetmaster
|
95
97
|
%config(noreplace) %{_sysconfdir}/puppet/*
|
@@ -99,7 +101,7 @@ find %{buildroot}%{ruby_sitelibdir} -type f -perm +ugo+x -print0 | xargs -0 -r %
|
|
99
101
|
%pre
|
100
102
|
/usr/sbin/groupadd -r puppet 2>/dev/null || :
|
101
103
|
/usr/sbin/useradd -g puppet -c "Puppet" \
|
102
|
-
-s /sbin/nologin -r -d /var/puppet puppet 2> /dev/null || :
|
104
|
+
-s /sbin/nologin -r -d /var/lib/puppet puppet 2> /dev/null || :
|
103
105
|
|
104
106
|
%post
|
105
107
|
/sbin/chkconfig --add puppet
|
@@ -0,0 +1,16 @@
|
|
1
|
+
--- sbin/puppetmasterd.orig 2009-11-23 10:38:16.632264990 -0500
|
2
|
+
+++ sbin/puppetmasterd 2009-11-23 10:38:28.884265155 -0500
|
3
|
+
@@ -1,4 +1,4 @@
|
4
|
+
-#!/usr/bin/env ruby
|
5
|
+
+#!/usr/bin/ruby
|
6
|
+
|
7
|
+
#
|
8
|
+
# = Synopsis
|
9
|
+
--- sbin/puppetd.orig 2009-11-23 10:38:23.240265893 -0500
|
10
|
+
+++ sbin/puppetd 2009-11-23 10:38:35.044265271 -0500
|
11
|
+
@@ -1,4 +1,4 @@
|
12
|
+
-#!/usr/bin/env ruby
|
13
|
+
+#!/usr/bin/ruby
|
14
|
+
# == Synopsis
|
15
|
+
#
|
16
|
+
# Retrieve the client configuration from the central puppet server and apply
|
@@ -2,12 +2,12 @@
|
|
2
2
|
|
3
3
|
[dist]
|
4
4
|
path /dist
|
5
|
-
allow *.
|
5
|
+
allow *.puppetlabs.com
|
6
6
|
|
7
7
|
[plugins]
|
8
|
-
path /var/puppet/plugins
|
9
|
-
allow *.
|
8
|
+
path /var/lib/puppet/plugins
|
9
|
+
allow *.puppetlabs.com
|
10
10
|
|
11
11
|
[facts]
|
12
|
-
path /var/puppet/facts
|
13
|
-
allow *.
|
12
|
+
path /var/lib/puppet/facts
|
13
|
+
allow *.puppetlabs.com
|
@@ -12,6 +12,6 @@ templates/sample.erb
|
|
12
12
|
Note the consistent naming of files for Puppet::Util::Autoload
|
13
13
|
|
14
14
|
Reference Documents:
|
15
|
-
http://
|
16
|
-
http://
|
17
|
-
http://
|
15
|
+
http://puppetlabs.com/trac/puppet/wiki/ModuleOrganisation
|
16
|
+
http://puppetlabs.com/trac/puppet/wiki/WritingYourOwnFunctions
|
17
|
+
http://puppetlabs.com/trac/puppet/wiki/FunctionReference
|
@@ -27,7 +27,7 @@
|
|
27
27
|
|
28
28
|
# Jeff McCune <jeff.mccune@northstarlabs.net>
|
29
29
|
# 2007-08-14
|
30
|
-
# See: http://
|
30
|
+
# See: http://puppetlabs.com/trac/puppet/wiki/WritingYourOwnFunctions
|
31
31
|
|
32
32
|
module Puppet::Parser::Functions
|
33
33
|
newfunction(:hostname_to_dn, :type => :rvalue, :doc => "Given 'foo.bar.com', return 'dc=foo,dc=bar,dc=com'.") do |args|
|
data/ext/extlookup.rb
CHANGED
@@ -74,7 +74,7 @@
|
|
74
74
|
# need to edit a load of manifests to do simple things like adjust a desired version number.
|
75
75
|
#
|
76
76
|
# For more information on installing and writing your own custom functions see:
|
77
|
-
# http://
|
77
|
+
# http://puppetlabs.com/trac/puppet/wiki/WritingYourOwnFunctions
|
78
78
|
#
|
79
79
|
# For further help contact Volcane on #puppet
|
80
80
|
require 'csv'
|
data/ext/nagios/check_puppet.rb
CHANGED
data/ext/nagios/naggen
CHANGED
@@ -29,7 +29,7 @@
|
|
29
29
|
# just like any other executable.
|
30
30
|
#
|
31
31
|
# See the configuration file documentation at
|
32
|
-
# http://
|
32
|
+
# http://puppetlabs.com/projects/puppet/reference/configref.html for
|
33
33
|
# the full list of acceptable parameters. A commented list of all
|
34
34
|
# configuration options can also be generated by running puppet with
|
35
35
|
# '--genconfig'.
|
@@ -63,7 +63,7 @@
|
|
63
63
|
#
|
64
64
|
# = Copyright
|
65
65
|
#
|
66
|
-
# Copyright (c) 2009
|
66
|
+
# Copyright (c) 2009 Puppet Labs, LLC
|
67
67
|
# Licensed under the GPL 2
|
68
68
|
|
69
69
|
require 'puppet'
|
data/ext/puppet-test
CHANGED
@@ -23,7 +23,7 @@
|
|
23
23
|
# parameter, so you can specify '--server <servername>' as an argument.
|
24
24
|
#
|
25
25
|
# See the configuration file documentation at
|
26
|
-
# http://
|
26
|
+
# http://puppetlabs.com/projects/puppet/reference/configref.html for
|
27
27
|
# the full list of acceptable parameters. A commented list of all
|
28
28
|
# configuration $options can also be generated by running puppetd with
|
29
29
|
# '--genconfig'.
|
@@ -90,7 +90,7 @@
|
|
90
90
|
#
|
91
91
|
# = Copyright
|
92
92
|
#
|
93
|
-
# Copyright (c) 2005, 2006
|
93
|
+
# Copyright (c) 2005, 2006 Puppet Labs, LLC
|
94
94
|
# Licensed under the GNU Public License
|
95
95
|
|
96
96
|
# Do an initial trap, so that cancels don't get a stack trace.
|
data/ext/puppetlast
CHANGED
@@ -12,5 +12,5 @@ Puppet[:name] = "puppetmasterd"
|
|
12
12
|
Puppet::Node::Facts.terminus_class = :yaml
|
13
13
|
|
14
14
|
Puppet::Node::Facts.search("*").sort { |a,b| a.name <=> b.name }.each do |node|
|
15
|
-
puts "#{node.name}
|
15
|
+
puts "#{node.name} checked in #{((Time.now - Time.parse(node.values[:_timestamp].to_s)) / 60).floor} minutes ago. Version #{node.values['puppetversion']}#{node.expired? ? ' Cache expired.' : ''}"
|
16
16
|
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# Script to clean up stored configs for (a) given host(s)
|
4
4
|
#
|
5
5
|
# Credits:
|
6
|
-
# Script was taken from http://
|
6
|
+
# Script was taken from http://puppetlabs.com/trac/puppet/attachment/wiki/UsingStoredConfiguration/kill_node_in_storedconfigs_db.rb
|
7
7
|
# which haven been initially posted by James Turnbull
|
8
8
|
# duritong adapted and improved the script a bit.
|
9
9
|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# = Synopsis
|
4
4
|
# This is an external node classifier script, after
|
5
|
-
# http://
|
5
|
+
# http://puppetlabs.com/trac/puppet/wiki/ExternalNodes
|
6
6
|
#
|
7
7
|
# = Usage
|
8
8
|
# regexp_nodes.rb <host>
|
@@ -43,14 +43,14 @@ require 'set'
|
|
43
43
|
# set up some nice logging
|
44
44
|
require 'logger'
|
45
45
|
# XXX flip this for production vs local sandbox
|
46
|
-
# $LOG = Logger.new("/var/puppet/log/extnodes.log")
|
46
|
+
# $LOG = Logger.new("/var/lib/puppet/log/extnodes.log")
|
47
47
|
# $LOG.level = Logger::FATAL
|
48
48
|
$LOG = Logger.new($stderr)
|
49
49
|
$LOG.level = Logger::DEBUG
|
50
50
|
|
51
51
|
# paths for files we use will be relative to this directory
|
52
52
|
# XXX flip this for production vs local sandbox
|
53
|
-
# WORKINGDIR = "/var/puppet/bin"
|
53
|
+
# WORKINGDIR = "/var/lib/puppet/bin"
|
54
54
|
WORKINGDIR = Dir.pwd
|
55
55
|
|
56
56
|
# This class holds all the methods for creating and accessing the properties
|
@@ -154,7 +154,7 @@ class ExternalNode
|
|
154
154
|
# directories to get the parameter name, then use the names of the files
|
155
155
|
# contained in there for the values of those parameters.
|
156
156
|
#
|
157
|
-
# ex: cat /var/puppet/bin/parameters/environment/production
|
157
|
+
# ex: cat /var/lib/puppet/bin/parameters/environment/production
|
158
158
|
# ^prodweb
|
159
159
|
# would set parameters["environment"] = "production" for prodweb001
|
160
160
|
def match_parameters(fullpath)
|
data/ext/vim/syntax/puppet.vim
CHANGED
@@ -19,7 +19,7 @@ endif
|
|
19
19
|
" match class/definition/node declarations
|
20
20
|
syn region puppetDefine start="^\s*\(class\|define\|node\)\s" end="{" contains=puppetDefType,puppetDefName,puppetDefArguments,puppetNodeRe
|
21
21
|
syn keyword puppetDefType class define node inherits contained
|
22
|
-
syn region puppetDefArguments start="(" end=")" contains=puppetArgument
|
22
|
+
syn region puppetDefArguments start="(" end=")" contained contains=puppetArgument
|
23
23
|
syn match puppetArgument "\w\+" contained
|
24
24
|
syn match puppetArgument "\$\w\+" contained
|
25
25
|
syn match puppetArgument "'[^']+'" contained
|
@@ -51,8 +51,10 @@ syn match puppetParamDigits "[0-9]\+"
|
|
51
51
|
|
52
52
|
" match 'template' in 'content => template("...")'
|
53
53
|
syn match puppetParam "\w\+\s*[=+]>\s*\w\+\s*(" contains=puppetFunction,puppetParamName
|
54
|
-
|
55
|
-
syn
|
54
|
+
" statements
|
55
|
+
syn region puppetFunction start="^\s*\(alert\|crit\|debug\|emerg\|err\|fail\|include\|info\|notice\|realize\|require\|search\|tag\|warning\)\s*(" end=")" contained contains=puppetString
|
56
|
+
" rvalues
|
57
|
+
syn region puppetFunction start="^\s*\(defined\|file\|fqdn_rand\|generate\|inline_template\|regsubst\|sha1\|shellquote\|split\|sprintf\|tagged\|template\|versioncmp\)\s*(" end=")" contained contains=puppetString
|
56
58
|
|
57
59
|
syn match puppetVariable "$\w\+"
|
58
60
|
syn match puppetVariable "${\w\+}"
|
data/install.rb
CHANGED
@@ -83,7 +83,7 @@ sbins = glob(%w{sbin/*})
|
|
83
83
|
bins = glob(%w{bin/*})
|
84
84
|
rdoc = glob(%w{bin/* sbin/* lib/**/*.rb README README-library CHANGELOG TODO Install}).reject { |e| e=~ /\.(bat|cmd)$/ }
|
85
85
|
ri = glob(%w(bin/*.rb sbin/* lib/**/*.rb)).reject { |e| e=~ /\.(bat|cmd)$/ }
|
86
|
-
man = glob(%w{man/
|
86
|
+
man = glob(%w{man/man[0-9]/*})
|
87
87
|
libs = glob(%w{lib/**/*.rb lib/**/*.py})
|
88
88
|
tests = glob(%w{test/**/*.rb})
|
89
89
|
|
@@ -238,7 +238,7 @@ def prepare_installation
|
|
238
238
|
opts.parse!
|
239
239
|
end
|
240
240
|
|
241
|
-
tmpdirs = [
|
241
|
+
tmpdirs = [ENV['TMP'], ENV['TEMP'], "/tmp", "/var/tmp", "."]
|
242
242
|
|
243
243
|
version = [Config::CONFIG["MAJOR"], Config::CONFIG["MINOR"]].join(".")
|
244
244
|
libdir = File.join(Config::CONFIG["libdir"], "ruby", version)
|
@@ -349,25 +349,27 @@ def build_ri(files)
|
|
349
349
|
end
|
350
350
|
end
|
351
351
|
|
352
|
-
def build_man(bins)
|
352
|
+
def build_man(bins, sbins)
|
353
353
|
return unless $haveman
|
354
354
|
begin
|
355
355
|
# Locate rst2man
|
356
356
|
rst2man = %x{which rst2man.py}
|
357
357
|
rst2man.chomp!
|
358
|
-
# Create puppet.conf.
|
358
|
+
# Create puppet.conf.5 man page
|
359
359
|
%x{bin/puppetdoc --reference configuration > ./puppet.conf.rst}
|
360
|
-
%x{#{rst2man} ./puppet.conf.rst ./man/
|
360
|
+
%x{#{rst2man} ./puppet.conf.rst ./man/man5/puppet.conf.5}
|
361
361
|
File.unlink("./puppet.conf.rst")
|
362
362
|
|
363
363
|
# Create binary man pages
|
364
|
-
bins
|
365
|
-
|
364
|
+
binary = bins + sbins
|
365
|
+
binary.each do |bin|
|
366
|
+
b = bin.gsub( /(bin|sbin)\//, "")
|
366
367
|
%x{#{bin} --help > ./#{b}.rst}
|
367
368
|
%x{#{rst2man} ./#{b}.rst ./man/man8/#{b}.8}
|
368
369
|
File.unlink("./#{b}.rst")
|
369
370
|
end
|
370
|
-
|
371
|
+
|
372
|
+
rescue SystemCallError
|
371
373
|
$stderr.puts "Couldn't build man pages: " + $!
|
372
374
|
$stderr.puts "Continuing with install..."
|
373
375
|
end
|
@@ -470,7 +472,7 @@ prepare_installation
|
|
470
472
|
#run_tests(tests) if InstallOptions.tests
|
471
473
|
#build_rdoc(rdoc) if InstallOptions.rdoc
|
472
474
|
#build_ri(ri) if InstallOptions.ri
|
473
|
-
#build_man(bins) if InstallOptions.man
|
475
|
+
#build_man(bins, sbins) if InstallOptions.man
|
474
476
|
do_bins(sbins, InstallOptions.sbin_dir)
|
475
477
|
do_bins(bins, InstallOptions.bin_dir)
|
476
478
|
do_libs(libs)
|
data/lib/puppet.rb
CHANGED
@@ -206,14 +206,15 @@ Puppet::Application.new(:puppetd) do
|
|
206
206
|
|
207
207
|
Puppet.settings.use :main, :puppetd, :ssl
|
208
208
|
|
209
|
-
#
|
210
|
-
# until the REST cert transfers are working, it needs to
|
211
|
-
# be local.
|
209
|
+
# This configures all of the SSL-related indirected classes.
|
212
210
|
Puppet::SSL::Host.ca_location = :remote
|
213
211
|
|
214
212
|
Puppet::Transaction::Report.terminus_class = :rest
|
215
213
|
|
216
|
-
|
214
|
+
# Override the default; puppetd needs this, usually.
|
215
|
+
# You can still override this on the command-line with, e.g., :compiler.
|
216
|
+
Puppet[:catalog_terminus] = :rest
|
217
|
+
|
217
218
|
Puppet::Resource::Catalog.cache_class = :yaml
|
218
219
|
|
219
220
|
Puppet::Node::Facts.terminus_class = :facter
|
data/lib/puppet/configurer.rb
CHANGED
@@ -91,47 +91,27 @@ class Puppet::Configurer
|
|
91
91
|
|
92
92
|
# Get the remote catalog, yo. Returns nil if no catalog can be found.
|
93
93
|
def retrieve_catalog
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
# First try it with no cache, then with the cache.
|
103
|
-
result = nil
|
104
|
-
begin
|
105
|
-
duration = thinmark do
|
106
|
-
result = catalog_class.find(name, fact_options.merge(:ignore_cache => true))
|
107
|
-
end
|
108
|
-
rescue SystemExit,NoMemoryError
|
109
|
-
raise
|
110
|
-
rescue Exception => detail
|
111
|
-
puts detail.backtrace if Puppet[:trace]
|
112
|
-
Puppet.err "Could not retrieve catalog from remote server: %s" % detail
|
94
|
+
if Puppet::Resource::Catalog.indirection.terminus_class == :rest
|
95
|
+
# This is a bit complicated. We need the serialized and escaped facts,
|
96
|
+
# and we need to know which format they're encoded in. Thus, we
|
97
|
+
# get a hash with both of these pieces of information.
|
98
|
+
fact_options = facts_for_uploading()
|
99
|
+
else
|
100
|
+
fact_options = {}
|
113
101
|
end
|
114
102
|
|
115
|
-
|
103
|
+
# First try it with no cache, then with the cache.
|
104
|
+
unless (Puppet[:use_cached_catalog] and result = retrieve_catalog_from_cache(fact_options)) or result = retrieve_new_catalog(fact_options)
|
116
105
|
if ! Puppet[:usecacheonfailure]
|
117
106
|
Puppet.warning "Not using cache on failed catalog"
|
118
107
|
return nil
|
119
108
|
end
|
120
|
-
|
121
|
-
begin
|
122
|
-
duration = thinmark do
|
123
|
-
result = catalog_class.find(name, fact_options.merge(:ignore_terminus => true))
|
124
|
-
end
|
125
|
-
Puppet.notice "Using cached catalog"
|
126
|
-
rescue => detail
|
127
|
-
puts detail.backtrace if Puppet[:trace]
|
128
|
-
Puppet.err "Could not retrieve catalog from cache: %s" % detail
|
129
|
-
end
|
109
|
+
result = retrieve_catalog_from_cache(fact_options)
|
130
110
|
end
|
131
111
|
|
132
112
|
return nil unless result
|
133
113
|
|
134
|
-
convert_catalog(result, duration)
|
114
|
+
convert_catalog(result, @duration)
|
135
115
|
end
|
136
116
|
|
137
117
|
# Convert a plain resource catalog into our full host catalog.
|
@@ -208,4 +188,31 @@ class Puppet::Configurer
|
|
208
188
|
raise CommandHookError, "Could not run command from #{setting}: #{detail}"
|
209
189
|
end
|
210
190
|
end
|
191
|
+
|
192
|
+
def retrieve_catalog_from_cache(fact_options)
|
193
|
+
result = nil
|
194
|
+
@duration = thinmark do
|
195
|
+
result = Puppet::Resource::Catalog.find(Puppet[:certname], fact_options.merge(:ignore_terminus => true))
|
196
|
+
end
|
197
|
+
Puppet.notice "Using cached catalog"
|
198
|
+
result
|
199
|
+
rescue => detail
|
200
|
+
puts detail.backtrace if Puppet[:trace]
|
201
|
+
Puppet.err "Could not retrieve catalog from cache: %s" % detail
|
202
|
+
return nil
|
203
|
+
end
|
204
|
+
|
205
|
+
def retrieve_new_catalog(fact_options)
|
206
|
+
result = nil
|
207
|
+
@duration = thinmark do
|
208
|
+
result = Puppet::Resource::Catalog.find(Puppet[:certname], fact_options.merge(:ignore_cache => true))
|
209
|
+
end
|
210
|
+
result
|
211
|
+
rescue SystemExit,NoMemoryError
|
212
|
+
raise
|
213
|
+
rescue Exception => detail
|
214
|
+
puts detail.backtrace if Puppet[:trace]
|
215
|
+
Puppet.err "Could not retrieve catalog from remote server: %s" % detail
|
216
|
+
return nil
|
217
|
+
end
|
211
218
|
end
|