puppet 0.9.2 → 0.13.0
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 +58 -0
- data/README +21 -18
- data/Rakefile +176 -36
- data/bin/puppet +34 -48
- data/bin/puppetca +41 -28
- data/bin/puppetd +87 -65
- data/bin/puppetdoc +99 -23
- data/bin/puppetmasterd +72 -91
- data/conf/redhat/client.init +80 -0
- data/conf/redhat/client.sysconfig +11 -0
- data/conf/redhat/fileserver.conf +12 -0
- data/conf/redhat/puppet.spec +130 -0
- data/conf/redhat/server.init +89 -0
- data/conf/redhat/server.sysconfig +9 -0
- data/examples/code/allatonce +2 -2
- data/examples/code/assignments +1 -1
- data/examples/code/classing +2 -2
- data/examples/code/components +2 -2
- data/examples/code/file.bl +5 -5
- data/examples/code/filedefaults +2 -2
- data/examples/code/fileparsing +1 -1
- data/examples/code/filerecursion +1 -1
- data/examples/code/functions +1 -1
- data/examples/code/groups +1 -1
- data/examples/code/importing +1 -1
- data/examples/code/nodes +1 -1
- data/examples/code/one +1 -1
- data/examples/code/relationships +2 -2
- data/examples/code/simpletests +5 -5
- data/examples/code/snippets/argumentdefaults +2 -2
- data/examples/code/snippets/casestatement +16 -8
- data/examples/code/snippets/classheirarchy.pp +4 -4
- data/examples/code/snippets/classincludes.pp +4 -4
- data/examples/code/snippets/classpathtest +2 -2
- data/examples/code/snippets/componentmetaparams.pp +11 -0
- data/examples/code/snippets/dirchmod +5 -5
- data/examples/code/snippets/emptyclass.pp +9 -0
- data/examples/code/snippets/failmissingexecpath.pp +1 -1
- data/examples/code/snippets/falsevalues.pp +1 -1
- data/examples/code/snippets/filecreate +5 -5
- data/examples/code/snippets/implicititeration +5 -5
- data/examples/code/snippets/multipleinstances +4 -4
- data/examples/code/snippets/namevartest +3 -3
- data/examples/code/snippets/scopetest +1 -1
- data/examples/code/snippets/selectorvalues.pp +3 -3
- data/examples/code/snippets/simpledefaults +2 -2
- data/examples/code/snippets/simpleselector +5 -5
- data/examples/code/snippets/singleary.pp +19 -0
- data/examples/root/etc/init.d/sleeper +3 -2
- data/ext/emacs/puppet-mode-init.el +6 -0
- data/ext/emacs/puppet-mode.el +189 -0
- data/ext/ldap/puppet.schema +17 -0
- data/ext/{module:puppet → module_puppet} +30 -31
- data/ext/vim/filetype.vim +9 -0
- data/ext/vim/puppet.vim +87 -0
- data/install.rb +63 -30
- data/lib/puppet.rb +216 -122
- data/lib/puppet/client.rb +51 -416
- data/lib/puppet/client/ca.rb +17 -0
- data/lib/puppet/client/dipper.rb +78 -0
- data/lib/puppet/client/file.rb +20 -0
- data/lib/puppet/client/log.rb +17 -0
- data/lib/puppet/client/master.rb +246 -0
- data/lib/puppet/client/proxy.rb +27 -0
- data/lib/puppet/client/status.rb +7 -0
- data/lib/puppet/config.rb +563 -13
- data/lib/puppet/daemon.rb +50 -22
- data/lib/puppet/element.rb +4 -4
- data/lib/puppet/event-loop.rb +1 -0
- data/lib/puppet/event-loop/better-definers.rb +367 -0
- data/lib/puppet/event-loop/event-loop.rb +355 -0
- data/lib/puppet/event-loop/signal-system.rb +220 -0
- data/lib/puppet/event.rb +9 -11
- data/lib/puppet/filetype.rb +195 -0
- data/lib/puppet/log.rb +35 -12
- data/lib/puppet/metric.rb +2 -2
- data/lib/puppet/networkclient.rb +145 -0
- data/lib/puppet/parameter.rb +335 -0
- data/lib/puppet/parser/ast.rb +42 -1453
- data/lib/puppet/parser/ast/astarray.rb +88 -0
- data/lib/puppet/parser/ast/branch.rb +47 -0
- data/lib/puppet/parser/ast/caseopt.rb +66 -0
- data/lib/puppet/parser/ast/casestatement.rb +78 -0
- data/lib/puppet/parser/ast/classdef.rb +78 -0
- data/lib/puppet/parser/ast/compdef.rb +111 -0
- data/lib/puppet/parser/ast/component.rb +105 -0
- data/lib/puppet/parser/ast/hostclass.rb +82 -0
- data/lib/puppet/parser/ast/leaf.rb +86 -0
- data/lib/puppet/parser/ast/node.rb +103 -0
- data/lib/puppet/parser/ast/nodedef.rb +68 -0
- data/lib/puppet/parser/ast/objectdef.rb +336 -0
- data/lib/puppet/parser/ast/objectparam.rb +30 -0
- data/lib/puppet/parser/ast/objectref.rb +76 -0
- data/lib/puppet/parser/ast/selector.rb +60 -0
- data/lib/puppet/parser/ast/typedefaults.rb +45 -0
- data/lib/puppet/parser/ast/vardef.rb +44 -0
- data/lib/puppet/parser/interpreter.rb +31 -14
- data/lib/puppet/parser/lexer.rb +2 -4
- data/lib/puppet/parser/parser.rb +332 -242
- data/lib/puppet/parser/scope.rb +55 -38
- data/lib/puppet/server.rb +43 -44
- data/lib/puppet/server/authstore.rb +3 -6
- data/lib/puppet/server/ca.rb +5 -2
- data/lib/puppet/server/filebucket.rb +2 -4
- data/lib/puppet/server/fileserver.rb +28 -12
- data/lib/puppet/server/logger.rb +15 -4
- data/lib/puppet/server/master.rb +62 -7
- data/lib/puppet/sslcertificates.rb +41 -607
- data/lib/puppet/sslcertificates/ca.rb +291 -0
- data/lib/puppet/sslcertificates/certificate.rb +283 -0
- data/lib/puppet/statechange.rb +6 -1
- data/lib/puppet/storage.rb +67 -56
- data/lib/puppet/transaction.rb +25 -9
- data/lib/puppet/transportable.rb +102 -22
- data/lib/puppet/type.rb +1096 -315
- data/lib/puppet/type/component.rb +30 -21
- data/lib/puppet/type/cron.rb +409 -448
- data/lib/puppet/type/exec.rb +234 -174
- data/lib/puppet/type/group.rb +65 -82
- data/lib/puppet/type/nameservice.rb +247 -3
- data/lib/puppet/type/nameservice/netinfo.rb +29 -40
- data/lib/puppet/type/nameservice/objectadd.rb +52 -66
- data/lib/puppet/type/nameservice/posix.rb +6 -194
- data/lib/puppet/type/package.rb +447 -295
- data/lib/puppet/type/package/apt.rb +51 -50
- data/lib/puppet/type/package/bsd.rb +82 -0
- data/lib/puppet/type/package/dpkg.rb +85 -88
- data/lib/puppet/type/package/rpm.rb +67 -63
- data/lib/puppet/type/package/sun.rb +119 -98
- data/lib/puppet/type/package/yum.rb +41 -37
- data/lib/puppet/type/parsedtype.rb +295 -0
- data/lib/puppet/type/parsedtype/host.rb +143 -0
- data/lib/puppet/type/parsedtype/port.rb +232 -0
- data/lib/puppet/type/parsedtype/sshkey.rb +129 -0
- data/lib/puppet/type/pfile.rb +484 -460
- data/lib/puppet/type/pfile/checksum.rb +237 -181
- data/lib/puppet/type/pfile/content.rb +67 -0
- data/lib/puppet/type/pfile/ensure.rb +212 -0
- data/lib/puppet/type/pfile/group.rb +106 -105
- data/lib/puppet/type/pfile/mode.rb +98 -101
- data/lib/puppet/type/pfile/source.rb +228 -209
- data/lib/puppet/type/pfile/type.rb +18 -21
- data/lib/puppet/type/pfile/uid.rb +127 -130
- data/lib/puppet/type/pfilebucket.rb +68 -63
- data/lib/puppet/type/schedule.rb +341 -0
- data/lib/puppet/type/service.rb +351 -255
- data/lib/puppet/type/service/base.rb +9 -14
- data/lib/puppet/type/service/debian.rb +32 -38
- data/lib/puppet/type/service/init.rb +130 -130
- data/lib/puppet/type/service/smf.rb +48 -20
- data/lib/puppet/type/state.rb +229 -16
- data/lib/puppet/type/symlink.rb +51 -63
- data/lib/puppet/type/tidy.rb +105 -102
- data/lib/puppet/type/user.rb +118 -180
- data/lib/puppet/util.rb +100 -6
- data/test/certmgr/certmgr.rb +0 -1
- data/test/client/client.rb +4 -4
- data/test/executables/puppetbin.rb +7 -14
- data/test/executables/puppetca.rb +18 -24
- data/test/executables/puppetd.rb +7 -16
- data/test/executables/puppetmasterd.rb +7 -9
- data/test/executables/puppetmodule.rb +11 -16
- data/test/language/ast.rb +11 -7
- data/test/language/interpreter.rb +1 -1
- data/test/language/scope.rb +2 -0
- data/test/language/snippets.rb +30 -5
- data/test/language/transportable.rb +77 -0
- data/test/other/config.rb +316 -0
- data/test/other/events.rb +22 -21
- data/test/other/log.rb +14 -14
- data/test/other/metrics.rb +4 -8
- data/test/other/overrides.rb +5 -5
- data/test/other/relationships.rb +4 -2
- data/test/other/storage.rb +64 -3
- data/test/other/transactions.rb +20 -20
- data/test/parser/parser.rb +7 -4
- data/test/puppet/conffiles.rb +12 -12
- data/test/puppet/defaults.rb +13 -11
- data/test/puppet/utiltest.rb +14 -11
- data/test/puppettest.rb +156 -48
- data/test/server/bucket.rb +2 -2
- data/test/server/fileserver.rb +6 -6
- data/test/server/logger.rb +19 -11
- data/test/server/master.rb +33 -4
- data/test/server/server.rb +2 -7
- data/test/types/basic.rb +5 -7
- data/test/types/component.rb +22 -18
- data/test/types/cron.rb +111 -44
- data/test/types/exec.rb +116 -59
- data/test/types/file.rb +262 -137
- data/test/types/filebucket.rb +13 -15
- data/test/types/fileignoresource.rb +12 -16
- data/test/types/filesources.rb +73 -48
- data/test/types/filetype.rb +13 -15
- data/test/types/group.rb +15 -13
- data/test/types/host.rb +146 -0
- data/test/types/package.rb +74 -63
- data/test/types/port.rb +139 -0
- data/test/types/query.rb +8 -8
- data/test/types/schedule.rb +335 -0
- data/test/types/service.rb +137 -21
- data/test/types/sshkey.rb +140 -0
- data/test/types/symlink.rb +3 -5
- data/test/types/tidy.rb +5 -14
- data/test/types/type.rb +67 -11
- data/test/types/user.rb +25 -23
- metadata +186 -122
- data/lib/puppet/type/pfile/create.rb +0 -108
- data/lib/puppet/type/pprocess.rb +0 -97
- data/lib/puppet/type/typegen.rb +0 -149
- data/lib/puppet/type/typegen/filerecord.rb +0 -243
- data/lib/puppet/type/typegen/filetype.rb +0 -316
- data/test/other/state.rb +0 -106
data/bin/puppetmasterd
CHANGED
@@ -8,51 +8,33 @@
|
|
8
8
|
# = Usage
|
9
9
|
#
|
10
10
|
# puppetmasterd [-h|--help] [-d|--debug] [-v|--verbose] [-V|--version]
|
11
|
-
# [
|
12
|
-
# [-m|--manifest <site manifest>] [--noca] [-p|--port <port>]
|
13
|
-
# [--parseonly] [-s|--ssldir <cert directory>]
|
14
|
-
# [-c|--confdir <configuration directory>] [--vardir <var dir>]
|
11
|
+
# [--noca] [--nobucket]
|
15
12
|
#
|
16
13
|
# = Description
|
17
14
|
#
|
18
|
-
# This is the
|
19
|
-
# individual scripts that you write. If you need to execute site-wide
|
20
|
-
# scripts, use +puppetd+ and +puppetmasterd+.
|
15
|
+
# This is the puppet central daemon.
|
21
16
|
#
|
22
17
|
# = Options
|
23
18
|
#
|
24
|
-
#
|
25
|
-
#
|
26
|
-
#
|
27
|
-
# determine which hosts should have their certificates signed.
|
19
|
+
# Note that any configuration parameter that's valid in the configuration file
|
20
|
+
# is also a valid long argument. For example, 'ssldir' is a valid configuration
|
21
|
+
# parameter, so you can specify '--ssldir <directory>' as an argument.
|
28
22
|
#
|
29
|
-
#
|
30
|
-
# The configuration root directory, where +puppetmasterd+ defaults to looking
|
31
|
-
# for all of its configuration files. Defaults to +/etc/puppet+.
|
23
|
+
# See the configuration file for the full list of acceptable parameters.
|
32
24
|
#
|
33
25
|
# debug::
|
34
26
|
# Enable full debugging. Causes the daemon not to go into the background.
|
35
27
|
#
|
36
|
-
# fsconfig::
|
37
|
-
# Where to find the fileserver configuration file. Defaults to
|
38
|
-
# /etc/puppet/fileserver.conf. If the fileserver config file exists,
|
39
|
-
# the puppetmasterd daemon will automatically also become a fileserver.
|
40
|
-
#
|
41
28
|
# help::
|
42
29
|
# Print this help message.
|
43
30
|
#
|
44
|
-
# httplog::
|
45
|
-
# Where to send http logs (which are currently separate from Puppet logs).
|
46
|
-
# Defaults to /var/puppet/log/http.log.
|
47
|
-
#
|
48
31
|
# logdest::
|
49
32
|
# Where to send messages. Choose between syslog, the console, and a log file.
|
50
33
|
# Defaults to sending messages to /var/puppet/log/puppet.log, or the console
|
51
34
|
# if debugging or verbosity is enabled.
|
52
35
|
#
|
53
|
-
#
|
54
|
-
#
|
55
|
-
# configurations. Defaults to /etc/puppet/manifests/site.pp.
|
36
|
+
# nobucket::
|
37
|
+
# Do not function as a file bucket.
|
56
38
|
#
|
57
39
|
# noca::
|
58
40
|
# Do not function as a certificate authority.
|
@@ -60,20 +42,6 @@
|
|
60
42
|
# nonodes::
|
61
43
|
# Do not use individual node designations; each node will receive the result
|
62
44
|
# of evaluating the entire configuration.
|
63
|
-
#
|
64
|
-
# parseonly::
|
65
|
-
# Just parse the central manifest to verify it is syntactically correct.
|
66
|
-
#
|
67
|
-
# port::
|
68
|
-
# The port on which to listen. Defaults to 8139.
|
69
|
-
#
|
70
|
-
# ssldir::
|
71
|
-
# The directory in which to store certificates. Defaults to /etc/puppet/ssl.
|
72
|
-
#
|
73
|
-
# vardir::
|
74
|
-
# The variable-size directory, used for storing state. Defaults to
|
75
|
-
# /var/puppet.
|
76
|
-
#
|
77
45
|
# verbose::
|
78
46
|
# Enable verbosity. Causes the daemon not to go into the background.
|
79
47
|
#
|
@@ -97,24 +65,22 @@ require 'getoptlong'
|
|
97
65
|
require 'puppet'
|
98
66
|
require 'puppet/server'
|
99
67
|
|
100
|
-
|
101
|
-
[ "--autosign", "-a", GetoptLong::NO_ARGUMENT ],
|
102
|
-
[ "--confdir", "-c", GetoptLong::REQUIRED_ARGUMENT ],
|
68
|
+
options = [
|
103
69
|
[ "--debug", "-d", GetoptLong::NO_ARGUMENT ],
|
104
|
-
[ "--fsconfig", "-f", GetoptLong::REQUIRED_ARGUMENT ],
|
105
70
|
[ "--help", "-h", GetoptLong::NO_ARGUMENT ],
|
106
|
-
[ "--httplog", GetoptLong::NO_ARGUMENT ],
|
107
71
|
[ "--logdest", "-l", GetoptLong::REQUIRED_ARGUMENT ],
|
108
|
-
[ "--manifest", "-m", GetoptLong::REQUIRED_ARGUMENT ],
|
109
72
|
[ "--noca", GetoptLong::NO_ARGUMENT ],
|
73
|
+
[ "--nobucket", GetoptLong::NO_ARGUMENT ],
|
110
74
|
[ "--nonodes", GetoptLong::NO_ARGUMENT ],
|
111
|
-
[ "--parseonly", GetoptLong::NO_ARGUMENT ],
|
112
|
-
[ "--port", "-p", GetoptLong::REQUIRED_ARGUMENT ],
|
113
|
-
[ "--ssldir", "-s", GetoptLong::REQUIRED_ARGUMENT ],
|
114
|
-
[ "--vardir", GetoptLong::REQUIRED_ARGUMENT ],
|
115
75
|
[ "--verbose", "-v", GetoptLong::NO_ARGUMENT ],
|
116
76
|
[ "--version", "-V", GetoptLong::NO_ARGUMENT ]
|
117
|
-
|
77
|
+
]
|
78
|
+
Puppet::Log.newdestination(:syslog)
|
79
|
+
|
80
|
+
# Add all of the config parameters as valid options.
|
81
|
+
Puppet.config.addargs(options)
|
82
|
+
|
83
|
+
result = GetoptLong.new(*options)
|
118
84
|
|
119
85
|
$haveusage = true
|
120
86
|
|
@@ -128,27 +94,26 @@ haveca = true
|
|
128
94
|
master = {}
|
129
95
|
ca = {}
|
130
96
|
fs = {}
|
97
|
+
bucket = {}
|
131
98
|
args = {}
|
99
|
+
#user = Puppet[:user]
|
100
|
+
#group = Puppet[:group]
|
101
|
+
user = nil
|
102
|
+
group = nil
|
103
|
+
|
104
|
+
havebucket = true
|
132
105
|
|
133
106
|
parseonly = false
|
134
107
|
|
108
|
+
setdest = false
|
109
|
+
|
135
110
|
begin
|
136
111
|
result.each { |opt,arg|
|
137
112
|
case opt
|
138
|
-
when "--autosign"
|
139
|
-
ca[:autosign] = Puppet[:autosign]
|
140
|
-
when "--confdir"
|
141
|
-
Puppet[:puppetconf] = arg
|
142
113
|
when "--debug"
|
143
|
-
Puppet
|
144
|
-
Puppet
|
145
|
-
|
146
|
-
unless FileTest.exists?(arg)
|
147
|
-
$stderr.puts "File server configuration file %s does not exist" %
|
148
|
-
arg
|
149
|
-
exit(23)
|
150
|
-
end
|
151
|
-
fs[:Config] = arg
|
114
|
+
Puppet::Log.level = :debug
|
115
|
+
Puppet::Log.newdestination(:console)
|
116
|
+
setdest = true
|
152
117
|
when "--help"
|
153
118
|
if $haveusage
|
154
119
|
RDoc::usage && exit
|
@@ -156,37 +121,28 @@ begin
|
|
156
121
|
puts "No help available unless you have RDoc::usage installed"
|
157
122
|
exit
|
158
123
|
end
|
159
|
-
when "--httplog"
|
160
|
-
args[:AccessLog] = arg
|
161
|
-
when "--manifest"
|
162
|
-
master[:File] = arg
|
163
124
|
when "--noca"
|
164
125
|
haveca = false
|
126
|
+
when "--nobucket"
|
127
|
+
havebucket = false
|
165
128
|
when "--nonodes"
|
166
129
|
master[:UseNodes] = false
|
167
|
-
when "--parseonly"
|
168
|
-
parseonly = true
|
169
|
-
when "--port"
|
170
|
-
args[:Port] = arg
|
171
|
-
when "--ssldir"
|
172
|
-
Puppet[:ssldir] = arg
|
173
130
|
when "--logdest"
|
174
131
|
begin
|
175
|
-
Puppet
|
132
|
+
Puppet::Log.newdestination(arg)
|
133
|
+
setdest = true
|
176
134
|
rescue => detail
|
177
135
|
$stderr.puts detail.to_s
|
178
136
|
end
|
179
|
-
when "--vardir"
|
180
|
-
Puppet[:puppetvar] = arg
|
181
137
|
when "--version"
|
182
138
|
puts "%s" % Puppet.version
|
183
139
|
exit
|
184
140
|
when "--verbose"
|
185
|
-
|
186
|
-
Puppet
|
141
|
+
setdest = true
|
142
|
+
Puppet::Log.level = :info
|
143
|
+
Puppet::Log.newdestination :console
|
187
144
|
else
|
188
|
-
|
189
|
-
exit(1)
|
145
|
+
Puppet.config.handlearg(opt, arg)
|
190
146
|
end
|
191
147
|
}
|
192
148
|
rescue GetoptLong::InvalidOption => detail
|
@@ -198,8 +154,21 @@ rescue GetoptLong::InvalidOption => detail
|
|
198
154
|
#end
|
199
155
|
exit(1)
|
200
156
|
end
|
157
|
+
ca[:autosign] = Puppet[:autosign]
|
201
158
|
|
202
|
-
|
159
|
+
# Now parse the config
|
160
|
+
if Puppet[:config] and File.exists? Puppet[:config]
|
161
|
+
Puppet.config.parse(Puppet[:config])
|
162
|
+
end
|
163
|
+
|
164
|
+
Puppet.genconfig
|
165
|
+
Puppet.genmanifest
|
166
|
+
|
167
|
+
require 'etc'
|
168
|
+
|
169
|
+
Puppet::Util.chuser
|
170
|
+
|
171
|
+
if Puppet::Log.level == :debug or Puppet::Log.level == :info or parseonly
|
203
172
|
args[:Daemonize] = false
|
204
173
|
else
|
205
174
|
args[:Daemonize] = true
|
@@ -211,18 +180,23 @@ handlers = {
|
|
211
180
|
:Logger => {}
|
212
181
|
}
|
213
182
|
|
183
|
+
unless setdest
|
184
|
+
Puppet::Log.newdestination(:syslog)
|
185
|
+
end
|
214
186
|
|
215
187
|
if haveca
|
216
188
|
handlers[:CA] = ca
|
217
189
|
end
|
218
190
|
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
191
|
+
#if havebucket
|
192
|
+
# handlers[:FileBucket] = bucket
|
193
|
+
#end
|
194
|
+
|
195
|
+
if File.exists?(Puppet[:fileserverconfig])
|
196
|
+
fs[:Config] = Puppet[:fileserverconfig]
|
197
|
+
#else
|
198
|
+
# Puppet.notice "File server config %s does not exist; skipping file serving" %
|
199
|
+
# Puppet[:fileserverconfig]
|
226
200
|
end
|
227
201
|
|
228
202
|
if fs.include?(:Config)
|
@@ -240,14 +214,21 @@ rescue => detail
|
|
240
214
|
exit(1)
|
241
215
|
end
|
242
216
|
|
243
|
-
if parseonly
|
217
|
+
if Puppet[:parseonly]
|
244
218
|
# we would have already exited if the file weren't syntactically correct
|
245
219
|
exit(0)
|
246
220
|
end
|
247
221
|
|
222
|
+
if args[:Daemonize]
|
223
|
+
server.daemonize
|
224
|
+
end
|
225
|
+
|
248
226
|
trap(:INT) {
|
249
227
|
server.shutdown
|
250
228
|
}
|
229
|
+
|
230
|
+
Puppet.notice "Starting Puppet server version %s" % [Puppet.version]
|
231
|
+
|
251
232
|
begin
|
252
233
|
server.start
|
253
234
|
rescue => detail
|
@@ -255,4 +236,4 @@ rescue => detail
|
|
255
236
|
exit(1)
|
256
237
|
end
|
257
238
|
|
258
|
-
# $Id: puppetmasterd
|
239
|
+
# $Id: puppetmasterd 873 2006-02-07 23:12:33Z luke $
|
@@ -0,0 +1,80 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
# puppet Init script for running the puppet client daemon
|
3
|
+
#
|
4
|
+
# Author: Duane Griffin <d.griffin@psenterprise.com>
|
5
|
+
# David Lutterkort <dlutter@redhat.com>
|
6
|
+
#
|
7
|
+
# chkconfig: - 98 02
|
8
|
+
#
|
9
|
+
# description: Enables periodic system configuration checks through puppet.
|
10
|
+
# processname: puppet
|
11
|
+
# config: /etc/sysconfig/puppet
|
12
|
+
|
13
|
+
PATH=/usr/bin:/sbin:/bin:/usr/sbin
|
14
|
+
export PATH
|
15
|
+
|
16
|
+
[ -f /etc/sysconfig/puppet ] && . /etc/sysconfig/puppet
|
17
|
+
lockfile=${LOCKFILE-/var/lock/subsys/puppet}
|
18
|
+
pidfile=${PIDFILE-/var/run/puppet.pid}
|
19
|
+
puppetd=${PUPPETD-/usr/sbin/puppetd}
|
20
|
+
RETVAL=0
|
21
|
+
|
22
|
+
# Source function library.
|
23
|
+
. /etc/rc.d/init.d/functions
|
24
|
+
|
25
|
+
PUPPET_OPTS=""
|
26
|
+
[ -n "${PUPPET_SERVER}" ] && PUPPET_OPTS="--server=${PUPPET_SERVER}"
|
27
|
+
[ -n "$PUPPET_LOG" ] && PUPPET_OPTS="${PUPPET_OPTS} --logdest=${PUPPET_LOG}"
|
28
|
+
[ -n "$PUPPET_PORT" ] && PUPPET_OPTS="${PUPPET_OPTS} --port=${PUPPET_PORT}"
|
29
|
+
|
30
|
+
start() {
|
31
|
+
echo -n $"Starting puppetd: "
|
32
|
+
daemon $puppetd ${PUPPET_OPTS} ${PUPPET_EXTRA_OPTS}
|
33
|
+
RETVAL=$?
|
34
|
+
echo
|
35
|
+
[ $RETVAL = 0 ] && touch ${lockfile}
|
36
|
+
return $RETVAL
|
37
|
+
}
|
38
|
+
|
39
|
+
stop() {
|
40
|
+
echo -n $"Stopping puppetd: "
|
41
|
+
killproc $puppetd
|
42
|
+
RETVAL=$?
|
43
|
+
echo
|
44
|
+
[ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
|
45
|
+
}
|
46
|
+
|
47
|
+
restart() {
|
48
|
+
stop
|
49
|
+
start
|
50
|
+
}
|
51
|
+
|
52
|
+
case "$1" in
|
53
|
+
start)
|
54
|
+
start
|
55
|
+
;;
|
56
|
+
stop)
|
57
|
+
stop
|
58
|
+
;;
|
59
|
+
restart|force-reload)
|
60
|
+
restart
|
61
|
+
;;
|
62
|
+
reload)
|
63
|
+
restart
|
64
|
+
;;
|
65
|
+
condrestart)
|
66
|
+
[ -f "$pidfile" ] && restart
|
67
|
+
;;
|
68
|
+
status)
|
69
|
+
status $puppetd
|
70
|
+
;;
|
71
|
+
once)
|
72
|
+
shift
|
73
|
+
$puppetd -o ${PUPPET_OPTS} ${PUPPET_EXTRA_OPTS} $@
|
74
|
+
;;
|
75
|
+
*)
|
76
|
+
echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart|once}"
|
77
|
+
exit 1
|
78
|
+
esac
|
79
|
+
|
80
|
+
exit $RETVAL
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# The puppetmaster server
|
2
|
+
#PUPPET_SERVER=puppet
|
3
|
+
|
4
|
+
# If you wish to specify the port to connect to do so here
|
5
|
+
#PUPPET_PORT=8140
|
6
|
+
|
7
|
+
# Where to log to. Specify syslog to send log messages to the system log.
|
8
|
+
#PUPPET_LOG=syslog
|
9
|
+
|
10
|
+
# You may specify other parameters to the puppet client here
|
11
|
+
#PUPPET_EXTRA_OPTS=--waitforcert=500
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# This file consists of arbitrarily named sections/modules
|
2
|
+
# defining where files are served from and to whom
|
3
|
+
|
4
|
+
# Define a section 'files'
|
5
|
+
# Adapt the allow/deny settings to your needs. Order
|
6
|
+
# for allow/deny does not matter, allow always takes precedence
|
7
|
+
# over deny
|
8
|
+
[files]
|
9
|
+
path /var/puppet/files
|
10
|
+
# allow *.example.com
|
11
|
+
# deny *.evil.example.com
|
12
|
+
# allow 192.168.0.0/24
|
@@ -0,0 +1,130 @@
|
|
1
|
+
%define rubylibdir %(ruby -rrbconfig -e 'puts Config::CONFIG["sitelibdir"]')
|
2
|
+
%define _pbuild %{_builddir}/%{name}-%{version}
|
3
|
+
%define confdir conf/redhat
|
4
|
+
|
5
|
+
Summary: A network tool for managing many disparate systems
|
6
|
+
Name: puppet
|
7
|
+
Version: 0.13.0
|
8
|
+
Release: 1%{?dist}
|
9
|
+
License: GPL
|
10
|
+
Group: System Environment/Base
|
11
|
+
|
12
|
+
URL: http://reductivelabs.com/projects/puppet/
|
13
|
+
Source: http://reductivelabs.com/downloads/puppet/%{name}-%{version}.tgz
|
14
|
+
|
15
|
+
Requires: ruby >= 1.8.1
|
16
|
+
Requires: facter >= 1.1
|
17
|
+
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
18
|
+
BuildArchitectures: noarch
|
19
|
+
|
20
|
+
%description
|
21
|
+
Puppet lets you centrally manage every important aspect of your system using a
|
22
|
+
cross-platform specification language that manages all the separate elements
|
23
|
+
normally aggregated in different files, like users, cron jobs, and hosts,
|
24
|
+
along with obviously discrete elements like packages, services, and files.
|
25
|
+
|
26
|
+
%package server
|
27
|
+
Group: System Environment/Base
|
28
|
+
Summary: Server for the puppet system management tool
|
29
|
+
Requires: puppet = %{version}-%{release}
|
30
|
+
|
31
|
+
%description server
|
32
|
+
Provides the central puppet server daemon which provides manifests to clients.
|
33
|
+
The server can also function as a certificate authority and file server.
|
34
|
+
|
35
|
+
%prep
|
36
|
+
%setup -q
|
37
|
+
|
38
|
+
%install
|
39
|
+
%{__rm} -rf %{buildroot}
|
40
|
+
%{__install} -d -m0755 %{buildroot}%{_sbindir}
|
41
|
+
%{__install} -d -m0755 %{buildroot}%{_bindir}
|
42
|
+
%{__install} -d -m0755 %{buildroot}%{rubylibdir}
|
43
|
+
%{__install} -d -m0755 %{buildroot}%{_sysconfdir}/puppet/manifests
|
44
|
+
%{__install} -d -m0755 %{buildroot}%{_docdir}/%{name}-%{version}
|
45
|
+
%{__install} -d -m0755 %{buildroot}%{_localstatedir}/puppet
|
46
|
+
%{__install} -Dp -m0755 %{_pbuild}/bin/* %{buildroot}%{_sbindir}
|
47
|
+
%{__mv} %{buildroot}%{_sbindir}/puppet %{buildroot}%{_bindir}/puppet
|
48
|
+
%{__install} -Dp -m0644 %{_pbuild}/lib/puppet.rb %{buildroot}%{rubylibdir}/puppet.rb
|
49
|
+
%{__cp} -a %{_pbuild}/lib/puppet %{buildroot}%{rubylibdir}
|
50
|
+
%{__install} -Dp -m0644 %{confdir}/client.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/puppet
|
51
|
+
%{__install} -Dp -m0755 %{confdir}/client.init %{buildroot}%{_initrddir}/puppet
|
52
|
+
%{__install} -Dp -m0644 %{confdir}/server.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/puppetmaster
|
53
|
+
%{__install} -Dp -m0755 %{confdir}/server.init %{buildroot}%{_initrddir}/puppetmaster
|
54
|
+
%{__install} -Dp -m0644 %{confdir}/fileserver.conf %{buildroot}%{_sysconfdir}/puppet/fileserver.conf
|
55
|
+
|
56
|
+
%files
|
57
|
+
%defattr(-, root, root, 0755)
|
58
|
+
%{_bindir}/puppet
|
59
|
+
%{_sbindir}/puppetd
|
60
|
+
%{rubylibdir}/*
|
61
|
+
%{_localstatedir}/puppet
|
62
|
+
%{_initrddir}/puppet
|
63
|
+
%config(noreplace) %{_sysconfdir}/sysconfig/puppet
|
64
|
+
%doc CHANGELOG COPYING LICENSE README TODO examples
|
65
|
+
%exclude %{_sbindir}/puppetdoc
|
66
|
+
|
67
|
+
%files server
|
68
|
+
%{_sbindir}/puppetmasterd
|
69
|
+
%{_initrddir}/puppetmaster
|
70
|
+
%config(noreplace) %{_sysconfdir}/puppet/*
|
71
|
+
%config(noreplace) %{_sysconfdir}/sysconfig/puppetmaster
|
72
|
+
%config(noreplace) %{_sysconfdir}/puppet/fileserver.conf
|
73
|
+
%{_sbindir}/cf2puppet
|
74
|
+
%{_sbindir}/puppetca
|
75
|
+
|
76
|
+
%post
|
77
|
+
touch %{_localstatedir}/log/puppet.log
|
78
|
+
/sbin/chkconfig --add puppet
|
79
|
+
exit 0
|
80
|
+
|
81
|
+
%post server
|
82
|
+
touch %{_localstatedir}/log/puppetmaster.log
|
83
|
+
touch %{_localstatedir}/log/puppetmaster-http.log
|
84
|
+
/sbin/chkconfig --add puppetmaster
|
85
|
+
|
86
|
+
%preun
|
87
|
+
if [ "$1" = 0 ] ; then
|
88
|
+
/sbin/service puppet stop > /dev/null 2>&1
|
89
|
+
/sbin/chkconfig --del puppet
|
90
|
+
fi
|
91
|
+
|
92
|
+
%preun server
|
93
|
+
if [ "$1" = 0 ] ; then
|
94
|
+
/sbin/service puppetmaster stop > /dev/null 2>&1
|
95
|
+
/sbin/chkconfig --del puppetmaster
|
96
|
+
fi
|
97
|
+
|
98
|
+
%postun server
|
99
|
+
if [ "$1" -ge 1 ]; then
|
100
|
+
/sbin/service puppetmaster condrestart > /dev/null 2>&1
|
101
|
+
fi
|
102
|
+
|
103
|
+
%clean
|
104
|
+
%{__rm} -rf %{buildroot}
|
105
|
+
|
106
|
+
%changelog
|
107
|
+
* Mon Feb 6 2006 David Lutterkort <dlutter@redhat.com> - 0.12.1-1
|
108
|
+
- Don't mark initscripts as config files
|
109
|
+
|
110
|
+
* Mon Feb 6 2006 David Lutterkort <dlutter@redhat.com> - 0.12.0-2
|
111
|
+
- Fix BuildRoot. Add dist to release
|
112
|
+
|
113
|
+
* Tue Jan 17 2006 David Lutterkort <dlutter@redhat.com> - 0.11.0-1
|
114
|
+
- Rebuild
|
115
|
+
|
116
|
+
* Thu Jan 12 2006 David Lutterkort <dlutter@redhat.com> - 0.10.2-1
|
117
|
+
- Updated for 0.10.2 Fixed minor kink in how Source is given
|
118
|
+
|
119
|
+
* Wed Jan 11 2006 David Lutterkort <dlutter@redhat.com> - 0.10.1-3
|
120
|
+
- Added basic fileserver.conf
|
121
|
+
|
122
|
+
* Wed Jan 11 2006 David Lutterkort <dlutter@redhat.com> - 0.10.1-1
|
123
|
+
- Updated. Moved installation of library files to sitelibdir. Pulled
|
124
|
+
initscripts into separate files. Folded tools rpm into server
|
125
|
+
|
126
|
+
* Thu Nov 24 2005 Duane Griffin <d.griffin@psenterprise.com>
|
127
|
+
- Added init scripts for the client
|
128
|
+
|
129
|
+
* Wed Nov 23 2005 Duane Griffin <d.griffin@psenterprise.com>
|
130
|
+
- First packaging
|