puppet 0.13.2 → 0.13.6
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 +19 -0
- data/bin/puppet +15 -2
- data/bin/puppetd +7 -4
- data/bin/puppetmasterd +18 -7
- data/conf/redhat/puppet.spec +14 -7
- data/examples/code/snippets/singlequote.pp +11 -0
- data/ext/ldap/puppet.schema +4 -4
- data/ext/module_puppet +14 -0
- data/ext/tools/passwd2puppet +45 -0
- data/lib/puppet.rb +100 -106
- data/lib/puppet/client/ca.rb +6 -2
- data/lib/puppet/client/master.rb +11 -9
- data/lib/puppet/config.rb +219 -87
- data/lib/puppet/daemon.rb +23 -15
- data/lib/puppet/event.rb +10 -3
- data/lib/puppet/log.rb +5 -2
- data/lib/puppet/metric.rb +2 -20
- data/lib/puppet/parser/ast.rb +6 -6
- data/lib/puppet/parser/ast/astarray.rb +4 -3
- data/lib/puppet/parser/ast/caseopt.rb +3 -2
- data/lib/puppet/parser/ast/casestatement.rb +5 -4
- data/lib/puppet/parser/ast/classdef.rb +16 -15
- data/lib/puppet/parser/ast/compdef.rb +17 -53
- data/lib/puppet/parser/ast/component.rb +68 -24
- data/lib/puppet/parser/ast/hostclass.rb +46 -10
- data/lib/puppet/parser/ast/leaf.rb +14 -6
- data/lib/puppet/parser/ast/node.rb +17 -17
- data/lib/puppet/parser/ast/nodedef.rb +9 -4
- data/lib/puppet/parser/ast/objectdef.rb +85 -109
- data/lib/puppet/parser/ast/objectparam.rb +4 -3
- data/lib/puppet/parser/ast/objectref.rb +4 -3
- data/lib/puppet/parser/ast/selector.rb +6 -5
- data/lib/puppet/parser/ast/typedefaults.rb +4 -3
- data/lib/puppet/parser/ast/vardef.rb +4 -3
- data/lib/puppet/parser/interpreter.rb +24 -16
- data/lib/puppet/parser/lexer.rb +12 -5
- data/lib/puppet/parser/parser.rb +409 -367
- data/lib/puppet/parser/scope.rb +355 -123
- data/lib/puppet/server/ca.rb +11 -10
- data/lib/puppet/server/filebucket.rb +10 -1
- data/lib/puppet/server/fileserver.rb +5 -2
- data/lib/puppet/server/master.rb +3 -8
- data/lib/puppet/sslcertificates.rb +18 -31
- data/lib/puppet/sslcertificates/ca.rb +45 -33
- data/lib/puppet/statechange.rb +6 -14
- data/lib/puppet/storage.rb +14 -13
- data/lib/puppet/transaction.rb +80 -26
- data/lib/puppet/transportable.rb +15 -12
- data/lib/puppet/type.rb +67 -79
- data/lib/puppet/type/component.rb +28 -7
- data/lib/puppet/type/exec.rb +28 -10
- data/lib/puppet/type/group.rb +74 -2
- data/lib/puppet/type/nameservice.rb +6 -20
- data/lib/puppet/type/nameservice/netinfo.rb +4 -4
- data/lib/puppet/type/nameservice/objectadd.rb +8 -8
- data/lib/puppet/type/nameservice/pw.rb +94 -0
- data/lib/puppet/type/package.rb +6 -2
- data/lib/puppet/type/package/apt.rb +2 -2
- data/lib/puppet/type/package/bsd.rb +4 -4
- data/lib/puppet/type/package/dpkg.rb +3 -3
- data/lib/puppet/type/package/rpm.rb +2 -2
- data/lib/puppet/type/package/sun.rb +2 -2
- data/lib/puppet/type/package/yum.rb +8 -14
- data/lib/puppet/type/pfile.rb +19 -14
- data/lib/puppet/type/pfile/checksum.rb +8 -10
- data/lib/puppet/type/pfile/content.rb +4 -4
- data/lib/puppet/type/pfile/ensure.rb +21 -11
- data/lib/puppet/type/pfile/group.rb +34 -52
- data/lib/puppet/type/pfile/mode.rb +5 -6
- data/lib/puppet/type/pfile/source.rb +16 -14
- data/lib/puppet/type/schedule.rb +2 -2
- data/lib/puppet/type/service.rb +111 -57
- data/lib/puppet/type/service/debian.rb +7 -11
- data/lib/puppet/type/service/init.rb +2 -2
- data/lib/puppet/type/service/redhat.rb +35 -0
- data/lib/puppet/type/service/smf.rb +14 -7
- data/lib/puppet/type/symlink.rb +2 -2
- data/lib/puppet/type/user.rb +71 -3
- data/lib/puppet/util.rb +31 -6
- data/test/client/client.rb +22 -72
- data/test/executables/puppetd.rb +2 -2
- data/test/executables/puppetmasterd.rb +2 -1
- data/test/language/ast.rb +138 -20
- data/test/language/scope.rb +76 -23
- data/test/language/snippets.rb +17 -4
- data/test/other/config.rb +207 -22
- data/test/other/events.rb +18 -29
- data/test/other/metrics.rb +2 -1
- data/test/other/relationships.rb +31 -3
- data/test/other/transactions.rb +2 -2
- data/test/parser/lexer.rb +13 -5
- data/test/parser/parser.rb +33 -4
- data/test/puppet/conffiles.rb +2 -2
- data/test/puppet/defaults.rb +2 -2
- data/test/puppet/utiltest.rb +15 -1
- data/test/puppettest.rb +24 -10
- data/test/tagging/tagging.rb +6 -6
- data/test/test +4 -1
- data/test/types/component.rb +31 -9
- data/test/types/exec.rb +68 -5
- data/test/types/file.rb +49 -4
- data/test/types/group.rb +23 -3
- data/test/types/package.rb +10 -1
- data/test/types/query.rb +3 -3
- data/test/types/service.rb +71 -16
- data/test/types/tidy.rb +2 -3
- data/test/types/type.rb +4 -2
- data/test/types/user.rb +24 -2
- metadata +7 -2
data/CHANGELOG
CHANGED
@@ -1,3 +1,22 @@
|
|
1
|
+
0.13.6
|
2
|
+
Many, many small bug fixes
|
3
|
+
FreeBSD user/group support has been added
|
4
|
+
The configuration system has been rewritten so that daemons can now generate
|
5
|
+
and repair the files and directories they need. (Fixed bug #68.)
|
6
|
+
Fixed the element override issues; now only subclasses can override values.
|
7
|
+
|
8
|
+
0.13.5
|
9
|
+
Fixed packages so types can be specified
|
10
|
+
Added 'enable' state to services, although it does not work everywhere yet
|
11
|
+
|
12
|
+
0.13.4
|
13
|
+
A few important bug fixes, mostly in the parser.
|
14
|
+
|
15
|
+
0.13.3
|
16
|
+
Changed transactions to be one-stage instead of two
|
17
|
+
Changed all types to use self[:name] instead of self.name, to support
|
18
|
+
the symbolic naming implemented in 0.13.1
|
19
|
+
|
1
20
|
0.13.2
|
2
21
|
Changed package[answerfile] to package[adminfile], and added package[responsefile]
|
3
22
|
Fixed a bunch of internal functions to behave more consistently and usefully
|
data/bin/puppet
CHANGED
@@ -92,7 +92,6 @@ debug = false
|
|
92
92
|
verbose = false
|
93
93
|
noop = false
|
94
94
|
logfile = false
|
95
|
-
parseonly = false
|
96
95
|
loadclasses = false
|
97
96
|
classfile = nil
|
98
97
|
|
@@ -143,6 +142,20 @@ rescue GetoptLong::InvalidOption => detail
|
|
143
142
|
exit(1)
|
144
143
|
end
|
145
144
|
|
145
|
+
client = nil
|
146
|
+
server = nil
|
147
|
+
|
148
|
+
[:INT, :TERM].each do |signal|
|
149
|
+
trap(signal) do
|
150
|
+
Puppet.notice "Caught #{signal}; shutting down"
|
151
|
+
[client, server].each { |obj|
|
152
|
+
if obj
|
153
|
+
obj.shutdown
|
154
|
+
end
|
155
|
+
}
|
156
|
+
end
|
157
|
+
end
|
158
|
+
|
146
159
|
if debug
|
147
160
|
Puppet::Log.level = :debug
|
148
161
|
elsif verbose
|
@@ -177,7 +190,7 @@ begin
|
|
177
190
|
:Master => server,
|
178
191
|
:Cache => false
|
179
192
|
)
|
180
|
-
if parseonly
|
193
|
+
if Puppet[:parseonly]
|
181
194
|
exit(0)
|
182
195
|
end
|
183
196
|
client.getconfig
|
data/bin/puppetd
CHANGED
@@ -278,9 +278,12 @@ end
|
|
278
278
|
# now set up the network client with the certs, now that we have them
|
279
279
|
client.setcerts
|
280
280
|
|
281
|
-
|
282
|
-
|
283
|
-
}
|
281
|
+
[:INT, :TERM].each do |signal|
|
282
|
+
trap(signal) do
|
283
|
+
Puppet.notice "Caught #{signal}; shutting down"
|
284
|
+
client.shutdown
|
285
|
+
end
|
286
|
+
end
|
284
287
|
|
285
288
|
if onetime
|
286
289
|
begin
|
@@ -298,4 +301,4 @@ else
|
|
298
301
|
Puppet.start
|
299
302
|
end
|
300
303
|
|
301
|
-
# $Id: puppetd
|
304
|
+
# $Id: puppetd 945 2006-02-24 23:01:25Z luke $
|
data/bin/puppetmasterd
CHANGED
@@ -75,7 +75,7 @@ options = [
|
|
75
75
|
[ "--verbose", "-v", GetoptLong::NO_ARGUMENT ],
|
76
76
|
[ "--version", "-V", GetoptLong::NO_ARGUMENT ]
|
77
77
|
]
|
78
|
-
Puppet::Log.newdestination(:syslog)
|
78
|
+
#Puppet::Log.newdestination(:syslog)
|
79
79
|
|
80
80
|
# Add all of the config parameters as valid options.
|
81
81
|
Puppet.config.addargs(options)
|
@@ -164,8 +164,6 @@ Puppet.genmanifest
|
|
164
164
|
|
165
165
|
require 'etc'
|
166
166
|
|
167
|
-
Puppet::Util.chuser
|
168
|
-
|
169
167
|
if Puppet::Log.level == :debug or Puppet::Log.level == :info or parseonly
|
170
168
|
args[:Daemonize] = false
|
171
169
|
else
|
@@ -212,6 +210,15 @@ rescue => detail
|
|
212
210
|
exit(1)
|
213
211
|
end
|
214
212
|
|
213
|
+
if Process.uid == 0
|
214
|
+
begin
|
215
|
+
Puppet::Util.chuser
|
216
|
+
rescue => detail
|
217
|
+
$stderr.puts "Could not change user to %s: %s" % [Puppet[:user], detail]
|
218
|
+
exit(39)
|
219
|
+
end
|
220
|
+
end
|
221
|
+
|
215
222
|
if Puppet[:parseonly]
|
216
223
|
# we would have already exited if the file weren't syntactically correct
|
217
224
|
exit(0)
|
@@ -221,9 +228,13 @@ if args[:Daemonize]
|
|
221
228
|
server.daemonize
|
222
229
|
end
|
223
230
|
|
224
|
-
|
225
|
-
|
226
|
-
|
231
|
+
|
232
|
+
[:INT, :TERM].each do |signal|
|
233
|
+
trap(signal) do
|
234
|
+
Puppet.notice "Caught #{signal}; shutting down"
|
235
|
+
server.shutdown
|
236
|
+
end
|
237
|
+
end
|
227
238
|
|
228
239
|
Puppet.notice "Starting Puppet server version %s" % [Puppet.version]
|
229
240
|
|
@@ -234,4 +245,4 @@ rescue => detail
|
|
234
245
|
exit(1)
|
235
246
|
end
|
236
247
|
|
237
|
-
# $Id: puppetmasterd
|
248
|
+
# $Id: puppetmasterd 966 2006-03-02 17:12:26Z luke $
|
data/conf/redhat/puppet.spec
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
Summary: A network tool for managing many disparate systems
|
6
6
|
Name: puppet
|
7
|
-
Version: 0.13.
|
7
|
+
Version: 0.13.6
|
8
8
|
Release: 1%{?dist}
|
9
9
|
License: GPL
|
10
10
|
Group: System Environment/Base
|
@@ -49,6 +49,7 @@ The server can also function as a certificate authority and file server.
|
|
49
49
|
%{__mv} %{buildroot}%{_sbindir}/puppet %{buildroot}%{_bindir}/puppet
|
50
50
|
%{__install} -Dp -m0644 %{_pbuild}/lib/puppet.rb %{buildroot}%{rubylibdir}/puppet.rb
|
51
51
|
%{__cp} -a %{_pbuild}/lib/puppet %{buildroot}%{rubylibdir}
|
52
|
+
find %{buildroot}%{rubylibdir} -type f -perm +ugo+x -print0 | xargs -0 -r %{__chmod} a-x
|
52
53
|
%{__install} -Dp -m0644 %{confdir}/client.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/puppet
|
53
54
|
%{__install} -Dp -m0755 %{confdir}/client.init %{buildroot}%{_initrddir}/puppet
|
54
55
|
%{__install} -Dp -m0644 %{confdir}/server.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/puppetmaster
|
@@ -80,16 +81,13 @@ The server can also function as a certificate authority and file server.
|
|
80
81
|
%{_initrddir}/puppetmaster
|
81
82
|
%config(noreplace) %{_sysconfdir}/puppet/*
|
82
83
|
%config(noreplace) %{_sysconfdir}/sysconfig/puppetmaster
|
83
|
-
%config(noreplace) %{_sysconfdir}/puppet/fileserver.conf
|
84
|
-
%config(noreplace) %{_sysconfdir}/puppet/puppetmasterd.conf
|
85
84
|
%{_sbindir}/cf2puppet
|
86
85
|
%{_sbindir}/puppetca
|
87
86
|
|
88
87
|
%pre
|
89
|
-
|
90
|
-
|
91
|
-
/
|
92
|
-
-s /sbin/nologin -r -d /var/puppet puppet 2> /dev/null || :
|
88
|
+
/usr/sbin/groupadd -r puppet 2>/dev/null || :
|
89
|
+
/usr/sbin/useradd -g puppet -c "Puppet" \
|
90
|
+
-s /sbin/nologin -r -d /var/puppet puppet 2> /dev/null || :
|
93
91
|
|
94
92
|
%post
|
95
93
|
touch %{_localstatedir}/log/puppet.log
|
@@ -122,6 +120,15 @@ fi
|
|
122
120
|
%{__rm} -rf %{buildroot}
|
123
121
|
|
124
122
|
%changelog
|
123
|
+
* Wed Mar 1 2006 David Lutterkort <dlutter@redhat.com> - 0.13.5-1
|
124
|
+
- Removed use of fedora-usermgmt. It is not required for Fedora Extras and
|
125
|
+
makes it unnecessarily hard to use this rpm outside of Fedora. Just
|
126
|
+
allocate the puppet uid/gid dynamically
|
127
|
+
|
128
|
+
* Sun Feb 19 2006 David Lutterkort <dlutter@redhat.com> - 0.13.0-4
|
129
|
+
- Use fedora-usermgmt to create puppet user/group. Use uid/gid 24. Fixed
|
130
|
+
problem with listing fileserver.conf and puppetmaster.conf twice
|
131
|
+
|
125
132
|
* Wed Feb 8 2006 David Lutterkort <dlutter@redhat.com> - 0.13.0-3
|
126
133
|
- Fix puppetd.conf
|
127
134
|
|
data/ext/ldap/puppet.schema
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
# These OIDs are all fake. No guarantees there won't be conflicts.
|
2
2
|
#
|
3
|
-
# $Id: puppet.schema
|
3
|
+
# $Id: puppet.schema 931 2006-02-23 20:21:10Z luke $
|
4
4
|
|
5
|
-
attributetype ( 1.1.
|
5
|
+
attributetype ( 1.1.3.10 NAME 'puppetclass'
|
6
6
|
DESC 'Puppet Node Class'
|
7
7
|
EQUALITY caseIgnoreIA5Match
|
8
8
|
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
|
9
9
|
|
10
|
-
attributetype ( 1.1.
|
10
|
+
attributetype ( 1.1.3.9 NAME 'parentnode'
|
11
11
|
DESC 'Puppet Parent Node'
|
12
12
|
EQUALITY caseIgnoreIA5Match
|
13
13
|
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
|
14
14
|
|
15
|
-
objectclass ( 1.1.1.
|
15
|
+
objectclass ( 1.1.1.2 NAME 'puppetClient' SUP ipHost AUXILIARY
|
16
16
|
DESC 'Puppet Client objectclass'
|
17
17
|
MAY ( puppetclass $ parentnode ))
|
data/ext/module_puppet
CHANGED
@@ -132,6 +132,20 @@ if Puppet[:config] and File.exists? Puppet[:config]
|
|
132
132
|
Puppet.config.parse(Puppet[:config])
|
133
133
|
end
|
134
134
|
|
135
|
+
client = nil
|
136
|
+
server = nil
|
137
|
+
|
138
|
+
[:INT, :TERM].each do |signal|
|
139
|
+
trap(signal) do
|
140
|
+
Puppet.notice "Caught #{signal}; shutting down"
|
141
|
+
[client, server].each { |obj|
|
142
|
+
if obj
|
143
|
+
obj.shutdown
|
144
|
+
end
|
145
|
+
}
|
146
|
+
end
|
147
|
+
end
|
148
|
+
|
135
149
|
Puppet.genconfig
|
136
150
|
Puppet.genmanifest
|
137
151
|
|
@@ -0,0 +1,45 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
|
3
|
+
#--------------------
|
4
|
+
# Convert a passwd-format file to Puppet users
|
5
|
+
#
|
6
|
+
|
7
|
+
require 'getoptlong'
|
8
|
+
|
9
|
+
result = GetoptLong.new(
|
10
|
+
[ "--help", "-h", GetoptLong::NO_ARGUMENT ]
|
11
|
+
)
|
12
|
+
|
13
|
+
result.each { |opt,arg|
|
14
|
+
case opt
|
15
|
+
when "--help"
|
16
|
+
puts "There is no help yet"
|
17
|
+
exit
|
18
|
+
else
|
19
|
+
raise "Invalid option '#{opt}'"
|
20
|
+
end
|
21
|
+
}
|
22
|
+
|
23
|
+
fields = %w{uid gid comment home shell}
|
24
|
+
|
25
|
+
puts "user {"
|
26
|
+
ARGV.each do |file|
|
27
|
+
File.open(file) do |of|
|
28
|
+
of.sort.each do |line|
|
29
|
+
next if line =~ /^\s*#/
|
30
|
+
next if line =~ /^\s*$/
|
31
|
+
|
32
|
+
ary = line.chomp.split(":")
|
33
|
+
puts " " + ary.shift + ":"
|
34
|
+
ary.shift # get rid of that password field
|
35
|
+
|
36
|
+
puts fields.zip(ary).collect { |field, val|
|
37
|
+
" %s => \"%s\"" % [field, val]
|
38
|
+
}.join(",\n") + ";"
|
39
|
+
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
puts "}"
|
44
|
+
|
45
|
+
# $Id: passwd2puppet 943 2006-02-24 22:49:57Z luke $
|
data/lib/puppet.rb
CHANGED
@@ -14,7 +14,7 @@ require 'puppet/util'
|
|
14
14
|
#
|
15
15
|
# it's also a place to find top-level commands like 'debug'
|
16
16
|
module Puppet
|
17
|
-
PUPPETVERSION = '0.13.
|
17
|
+
PUPPETVERSION = '0.13.6'
|
18
18
|
|
19
19
|
def Puppet.version
|
20
20
|
return PUPPETVERSION
|
@@ -59,7 +59,11 @@ module Puppet
|
|
59
59
|
class DevError < Error; end
|
60
60
|
|
61
61
|
def self.name
|
62
|
-
|
62
|
+
unless defined? @name
|
63
|
+
@name = $0.gsub(/.+#{File::SEPARATOR}/,'').sub(/\.rb$/, '')
|
64
|
+
end
|
65
|
+
|
66
|
+
return @name
|
63
67
|
end
|
64
68
|
|
65
69
|
# the hash that determines how our system behaves
|
@@ -84,9 +88,8 @@ module Puppet
|
|
84
88
|
alias :error :err
|
85
89
|
|
86
90
|
# Store a new default value.
|
87
|
-
def self.setdefaults(section,
|
88
|
-
|
89
|
-
@@config.setdefaults(section, *arrays)
|
91
|
+
def self.setdefaults(section, hash)
|
92
|
+
@@config.setdefaults(section, hash)
|
90
93
|
end
|
91
94
|
|
92
95
|
# If we're running the standalone puppet process as a non-root user,
|
@@ -101,82 +104,117 @@ module Puppet
|
|
101
104
|
conf = "/etc/puppet"
|
102
105
|
var = "/var/puppet"
|
103
106
|
end
|
104
|
-
self.setdefaults(
|
105
|
-
|
106
|
-
|
107
|
+
self.setdefaults(:puppet,
|
108
|
+
:confdir => [conf, "The main Puppet configuration directory."],
|
109
|
+
:vardir => [var, "Where Puppet stores dynamic and growing data."],
|
110
|
+
:logdir => ["$vardir/log", "The Puppet log directory."],
|
111
|
+
:statedir => { :default => "$vardir/state",
|
112
|
+
:mode => 01777,
|
113
|
+
:desc => "The directory where Puppet state is stored. Generally,
|
114
|
+
this directory can be removed without causing harm (although it
|
115
|
+
might result in spurious service restarts)."
|
116
|
+
},
|
117
|
+
:rundir => { :default => "$vardir/run",
|
118
|
+
:mode => 01777,
|
119
|
+
:desc => "Where Puppet PID files are kept."
|
120
|
+
},
|
121
|
+
:lockdir => { :default => "$vardir/locks",
|
122
|
+
:mode => 01777,
|
123
|
+
:desc => "Where lock files are kept."
|
124
|
+
},
|
125
|
+
:statefile => { :default => "$statedir/state.yaml",
|
126
|
+
:mode => 0660,
|
127
|
+
:group => "$group",
|
128
|
+
:desc => "Where puppetd and puppetmasterd store state associated
|
129
|
+
with the running configuration. In the case of puppetmasterd,
|
130
|
+
this file reflects the state discovered through interacting
|
131
|
+
with clients."
|
132
|
+
},
|
133
|
+
:ssldir => {
|
134
|
+
:default => "$confdir/ssl",
|
135
|
+
:mode => 0770,
|
136
|
+
:owner => "root",
|
137
|
+
:desc => "Where SSL certificates are kept."
|
138
|
+
},
|
139
|
+
:genconfig => [false,
|
140
|
+
"Whether to just print a configuration to stdout and exit. Only makes
|
141
|
+
sense when used interactively. Takes into account arguments specified
|
142
|
+
on the CLI."],
|
143
|
+
:genmanifest => [false,
|
144
|
+
"Whether to just print a manifest to stdout and exit. Only makes
|
145
|
+
sense when used interactively. Takes into account arguments specified
|
146
|
+
on the CLI."],
|
147
|
+
:mkusers => [false,
|
148
|
+
"Whether to create the necessary user and group that puppetd will
|
149
|
+
run as."]
|
107
150
|
)
|
108
151
|
|
109
152
|
# Define the config default.
|
110
153
|
self.setdefaults(self.name,
|
111
|
-
|
154
|
+
:config => ["$confdir/#{self.name}.conf",
|
112
155
|
"The configuration file for #{self.name}."]
|
113
156
|
)
|
114
157
|
|
115
|
-
self.setdefaults("puppet",
|
116
|
-
[:logdir, "$vardir/log",
|
117
|
-
"The Puppet log directory."],
|
118
|
-
[:bucketdir, "$vardir/bucket",
|
119
|
-
"Where FileBucket files are stored."],
|
120
|
-
[:statedir, "$vardir/state",
|
121
|
-
"The directory where Puppet state is stored. Generally, this
|
122
|
-
directory can be removed without causing harm (although it might
|
123
|
-
result in spurious service restarts)."],
|
124
|
-
[:rundir, "$vardir/run", "Where Puppet PID files are kept."],
|
125
|
-
[:lockdir, "$vardir/locks", "Where lock files are kept."],
|
126
|
-
[:statefile, "$statedir/state.yaml",
|
127
|
-
"Where puppetd and puppetmasterd store state associated with the
|
128
|
-
running configuration. In the case of puppetmasterd, this file
|
129
|
-
reflects the state discovered through interacting with clients."],
|
130
|
-
[:ssldir, "$confdir/ssl", "Where SSL certificates are kept."],
|
131
|
-
[:genconfig, false,
|
132
|
-
"Whether to just print a configuration to stdout and exit. Only makes
|
133
|
-
sense when used interactively. Takes into account arguments specified
|
134
|
-
on the CLI."],
|
135
|
-
[:genmanifest, false,
|
136
|
-
"Whether to just print a manifest to stdout and exit. Only makes
|
137
|
-
sense when used interactively. Takes into account arguments specified
|
138
|
-
on the CLI."]
|
139
|
-
)
|
140
158
|
self.setdefaults("puppetmasterd",
|
141
|
-
[
|
159
|
+
:user => ["puppet", "The user puppetmasterd should run as."],
|
160
|
+
:group => ["puppet", "The group puppetmasterd should run as."],
|
161
|
+
:manifestdir => ["$confdir/manifests",
|
142
162
|
"Where puppetmasterd looks for its manifests."],
|
143
|
-
|
163
|
+
:manifest => ["$manifestdir/site.pp",
|
144
164
|
"The entry-point manifest for puppetmasterd."],
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
"Where
|
150
|
-
|
151
|
-
|
165
|
+
:masterlog => { :default => "$logdir/puppetmaster.log",
|
166
|
+
:owner => "$user",
|
167
|
+
:group => "$group",
|
168
|
+
:mode => 0660,
|
169
|
+
:desc => "Where puppetmasterd logs. This is generally not used,
|
170
|
+
since syslog is the default log destination."
|
171
|
+
},
|
172
|
+
:masterhttplog => { :default => "$logdir/masterhttp.log",
|
173
|
+
:owner => "$user",
|
174
|
+
:group => "$group",
|
175
|
+
:mode => 0660,
|
176
|
+
:create => true,
|
177
|
+
:desc => "Where the puppetmasterd web server logs."
|
178
|
+
},
|
179
|
+
:masterport => [8140, "Which port puppetmasterd listens on."],
|
180
|
+
:parseonly => [false, "Just check the syntax of the manifests."]
|
152
181
|
)
|
153
182
|
|
154
183
|
self.setdefaults("puppetd",
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
184
|
+
:localconfig => { :default => "$confdir/localconfig",
|
185
|
+
:owner => "root",
|
186
|
+
:mode => 0660,
|
187
|
+
:desc => "Where puppetd caches the local configuration. An
|
188
|
+
extension indicating the cache format is added automatically."},
|
189
|
+
:classfile => { :default => "$confdir/classes.txt",
|
190
|
+
:owner => "root",
|
191
|
+
:mode => 0644,
|
192
|
+
:desc => "The file in which puppetd stores a list of the classes
|
193
|
+
associated with the retrieved configuratiion."},
|
194
|
+
:puppetdlog => { :default => "$logdir/puppetd.log",
|
195
|
+
:owner => "root",
|
196
|
+
:mode => 0640,
|
197
|
+
:desc => "The log file for puppetd. This is generally not used."
|
198
|
+
},
|
199
|
+
:httplog => { :default => "$logdir/http.log",
|
200
|
+
:owner => "root",
|
201
|
+
:mode => 0640,
|
202
|
+
:desc => "Where the puppetd web server logs."
|
203
|
+
},
|
204
|
+
:server => ["puppet",
|
165
205
|
"The server to which server puppetd should connect"],
|
166
|
-
|
167
|
-
[:group, "puppet", "The group puppetmasterd should run as."],
|
168
|
-
[:ignoreschedules, false,
|
206
|
+
:ignoreschedules => [false,
|
169
207
|
"Boolean; whether puppetd should ignore schedules. This is useful
|
170
208
|
for initial puppetd runs."],
|
171
|
-
|
172
|
-
|
173
|
-
|
209
|
+
:puppetport => [8139, "Which port puppetd listens on."],
|
210
|
+
:noop => [false, "Whether puppetd should be run in noop mode."],
|
211
|
+
:runinterval => [1800, # 30 minutes
|
174
212
|
"How often puppetd applies the client configuration; in seconds"]
|
175
213
|
)
|
176
214
|
self.setdefaults("metrics",
|
177
|
-
|
215
|
+
:rrddir => ["$vardir/rrd",
|
178
216
|
"The directory where RRD database files are stored."],
|
179
|
-
|
217
|
+
:rrdgraph => [false, "Whether RRD information should be graphed."]
|
180
218
|
)
|
181
219
|
|
182
220
|
# configuration parameter access and stuff
|
@@ -196,20 +234,6 @@ module Puppet
|
|
196
234
|
# configuration parameter access and stuff
|
197
235
|
def self.[]=(param,value)
|
198
236
|
@@config[param] = value
|
199
|
-
# case param
|
200
|
-
# when :debug:
|
201
|
-
# if value
|
202
|
-
# Puppet::Log.level=(:debug)
|
203
|
-
# else
|
204
|
-
# Puppet::Log.level=(:notice)
|
205
|
-
# end
|
206
|
-
# when :loglevel:
|
207
|
-
# Puppet::Log.level=(value)
|
208
|
-
# when :logdest:
|
209
|
-
# Puppet::Log.newdestination(value)
|
210
|
-
# else
|
211
|
-
# @@config[param] = value
|
212
|
-
# end
|
213
237
|
end
|
214
238
|
|
215
239
|
def self.clear
|
@@ -265,36 +289,6 @@ module Puppet
|
|
265
289
|
@timer
|
266
290
|
end
|
267
291
|
|
268
|
-
# Store a new default value.
|
269
|
-
# def self.setdefaults(section, hash)
|
270
|
-
# @@config.setdefaults(section, hash)
|
271
|
-
# if value.is_a?(Array)
|
272
|
-
# if value[0].is_a?(Symbol)
|
273
|
-
# unless @defaults.include?(value[0])
|
274
|
-
# raise ArgumentError, "Unknown basedir %s for param %s" %
|
275
|
-
# [value[0], param]
|
276
|
-
# end
|
277
|
-
# else
|
278
|
-
# raise ArgumentError, "Invalid default %s for param %s" %
|
279
|
-
# [value.inspect, param]
|
280
|
-
# end
|
281
|
-
#
|
282
|
-
# unless value[1].is_a?(String)
|
283
|
-
# raise ArgumentError, "Invalid default %s for param %s" %
|
284
|
-
# [value.inspect, param]
|
285
|
-
# end
|
286
|
-
#
|
287
|
-
# unless value.length == 2
|
288
|
-
# raise ArgumentError, "Invalid default %s for param %s" %
|
289
|
-
# [value.inspect, param]
|
290
|
-
# end
|
291
|
-
#
|
292
|
-
# @defaults[param] = value
|
293
|
-
# else
|
294
|
-
# @defaults[param] = value
|
295
|
-
# end
|
296
|
-
# end
|
297
|
-
|
298
292
|
# XXX this should all be done using puppet objects, not using
|
299
293
|
# normal mkdir
|
300
294
|
def self.recmkdir(dir,mode = 0755)
|
@@ -341,4 +335,4 @@ require 'puppet/server'
|
|
341
335
|
require 'puppet/type'
|
342
336
|
require 'puppet/storage'
|
343
337
|
|
344
|
-
# $Id$
|
338
|
+
# $Id: puppet.rb 969 2006-03-02 20:39:13Z luke $
|