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.

Files changed (213) hide show
  1. data/CHANGELOG +58 -0
  2. data/README +21 -18
  3. data/Rakefile +176 -36
  4. data/bin/puppet +34 -48
  5. data/bin/puppetca +41 -28
  6. data/bin/puppetd +87 -65
  7. data/bin/puppetdoc +99 -23
  8. data/bin/puppetmasterd +72 -91
  9. data/conf/redhat/client.init +80 -0
  10. data/conf/redhat/client.sysconfig +11 -0
  11. data/conf/redhat/fileserver.conf +12 -0
  12. data/conf/redhat/puppet.spec +130 -0
  13. data/conf/redhat/server.init +89 -0
  14. data/conf/redhat/server.sysconfig +9 -0
  15. data/examples/code/allatonce +2 -2
  16. data/examples/code/assignments +1 -1
  17. data/examples/code/classing +2 -2
  18. data/examples/code/components +2 -2
  19. data/examples/code/file.bl +5 -5
  20. data/examples/code/filedefaults +2 -2
  21. data/examples/code/fileparsing +1 -1
  22. data/examples/code/filerecursion +1 -1
  23. data/examples/code/functions +1 -1
  24. data/examples/code/groups +1 -1
  25. data/examples/code/importing +1 -1
  26. data/examples/code/nodes +1 -1
  27. data/examples/code/one +1 -1
  28. data/examples/code/relationships +2 -2
  29. data/examples/code/simpletests +5 -5
  30. data/examples/code/snippets/argumentdefaults +2 -2
  31. data/examples/code/snippets/casestatement +16 -8
  32. data/examples/code/snippets/classheirarchy.pp +4 -4
  33. data/examples/code/snippets/classincludes.pp +4 -4
  34. data/examples/code/snippets/classpathtest +2 -2
  35. data/examples/code/snippets/componentmetaparams.pp +11 -0
  36. data/examples/code/snippets/dirchmod +5 -5
  37. data/examples/code/snippets/emptyclass.pp +9 -0
  38. data/examples/code/snippets/failmissingexecpath.pp +1 -1
  39. data/examples/code/snippets/falsevalues.pp +1 -1
  40. data/examples/code/snippets/filecreate +5 -5
  41. data/examples/code/snippets/implicititeration +5 -5
  42. data/examples/code/snippets/multipleinstances +4 -4
  43. data/examples/code/snippets/namevartest +3 -3
  44. data/examples/code/snippets/scopetest +1 -1
  45. data/examples/code/snippets/selectorvalues.pp +3 -3
  46. data/examples/code/snippets/simpledefaults +2 -2
  47. data/examples/code/snippets/simpleselector +5 -5
  48. data/examples/code/snippets/singleary.pp +19 -0
  49. data/examples/root/etc/init.d/sleeper +3 -2
  50. data/ext/emacs/puppet-mode-init.el +6 -0
  51. data/ext/emacs/puppet-mode.el +189 -0
  52. data/ext/ldap/puppet.schema +17 -0
  53. data/ext/{module:puppet → module_puppet} +30 -31
  54. data/ext/vim/filetype.vim +9 -0
  55. data/ext/vim/puppet.vim +87 -0
  56. data/install.rb +63 -30
  57. data/lib/puppet.rb +216 -122
  58. data/lib/puppet/client.rb +51 -416
  59. data/lib/puppet/client/ca.rb +17 -0
  60. data/lib/puppet/client/dipper.rb +78 -0
  61. data/lib/puppet/client/file.rb +20 -0
  62. data/lib/puppet/client/log.rb +17 -0
  63. data/lib/puppet/client/master.rb +246 -0
  64. data/lib/puppet/client/proxy.rb +27 -0
  65. data/lib/puppet/client/status.rb +7 -0
  66. data/lib/puppet/config.rb +563 -13
  67. data/lib/puppet/daemon.rb +50 -22
  68. data/lib/puppet/element.rb +4 -4
  69. data/lib/puppet/event-loop.rb +1 -0
  70. data/lib/puppet/event-loop/better-definers.rb +367 -0
  71. data/lib/puppet/event-loop/event-loop.rb +355 -0
  72. data/lib/puppet/event-loop/signal-system.rb +220 -0
  73. data/lib/puppet/event.rb +9 -11
  74. data/lib/puppet/filetype.rb +195 -0
  75. data/lib/puppet/log.rb +35 -12
  76. data/lib/puppet/metric.rb +2 -2
  77. data/lib/puppet/networkclient.rb +145 -0
  78. data/lib/puppet/parameter.rb +335 -0
  79. data/lib/puppet/parser/ast.rb +42 -1453
  80. data/lib/puppet/parser/ast/astarray.rb +88 -0
  81. data/lib/puppet/parser/ast/branch.rb +47 -0
  82. data/lib/puppet/parser/ast/caseopt.rb +66 -0
  83. data/lib/puppet/parser/ast/casestatement.rb +78 -0
  84. data/lib/puppet/parser/ast/classdef.rb +78 -0
  85. data/lib/puppet/parser/ast/compdef.rb +111 -0
  86. data/lib/puppet/parser/ast/component.rb +105 -0
  87. data/lib/puppet/parser/ast/hostclass.rb +82 -0
  88. data/lib/puppet/parser/ast/leaf.rb +86 -0
  89. data/lib/puppet/parser/ast/node.rb +103 -0
  90. data/lib/puppet/parser/ast/nodedef.rb +68 -0
  91. data/lib/puppet/parser/ast/objectdef.rb +336 -0
  92. data/lib/puppet/parser/ast/objectparam.rb +30 -0
  93. data/lib/puppet/parser/ast/objectref.rb +76 -0
  94. data/lib/puppet/parser/ast/selector.rb +60 -0
  95. data/lib/puppet/parser/ast/typedefaults.rb +45 -0
  96. data/lib/puppet/parser/ast/vardef.rb +44 -0
  97. data/lib/puppet/parser/interpreter.rb +31 -14
  98. data/lib/puppet/parser/lexer.rb +2 -4
  99. data/lib/puppet/parser/parser.rb +332 -242
  100. data/lib/puppet/parser/scope.rb +55 -38
  101. data/lib/puppet/server.rb +43 -44
  102. data/lib/puppet/server/authstore.rb +3 -6
  103. data/lib/puppet/server/ca.rb +5 -2
  104. data/lib/puppet/server/filebucket.rb +2 -4
  105. data/lib/puppet/server/fileserver.rb +28 -12
  106. data/lib/puppet/server/logger.rb +15 -4
  107. data/lib/puppet/server/master.rb +62 -7
  108. data/lib/puppet/sslcertificates.rb +41 -607
  109. data/lib/puppet/sslcertificates/ca.rb +291 -0
  110. data/lib/puppet/sslcertificates/certificate.rb +283 -0
  111. data/lib/puppet/statechange.rb +6 -1
  112. data/lib/puppet/storage.rb +67 -56
  113. data/lib/puppet/transaction.rb +25 -9
  114. data/lib/puppet/transportable.rb +102 -22
  115. data/lib/puppet/type.rb +1096 -315
  116. data/lib/puppet/type/component.rb +30 -21
  117. data/lib/puppet/type/cron.rb +409 -448
  118. data/lib/puppet/type/exec.rb +234 -174
  119. data/lib/puppet/type/group.rb +65 -82
  120. data/lib/puppet/type/nameservice.rb +247 -3
  121. data/lib/puppet/type/nameservice/netinfo.rb +29 -40
  122. data/lib/puppet/type/nameservice/objectadd.rb +52 -66
  123. data/lib/puppet/type/nameservice/posix.rb +6 -194
  124. data/lib/puppet/type/package.rb +447 -295
  125. data/lib/puppet/type/package/apt.rb +51 -50
  126. data/lib/puppet/type/package/bsd.rb +82 -0
  127. data/lib/puppet/type/package/dpkg.rb +85 -88
  128. data/lib/puppet/type/package/rpm.rb +67 -63
  129. data/lib/puppet/type/package/sun.rb +119 -98
  130. data/lib/puppet/type/package/yum.rb +41 -37
  131. data/lib/puppet/type/parsedtype.rb +295 -0
  132. data/lib/puppet/type/parsedtype/host.rb +143 -0
  133. data/lib/puppet/type/parsedtype/port.rb +232 -0
  134. data/lib/puppet/type/parsedtype/sshkey.rb +129 -0
  135. data/lib/puppet/type/pfile.rb +484 -460
  136. data/lib/puppet/type/pfile/checksum.rb +237 -181
  137. data/lib/puppet/type/pfile/content.rb +67 -0
  138. data/lib/puppet/type/pfile/ensure.rb +212 -0
  139. data/lib/puppet/type/pfile/group.rb +106 -105
  140. data/lib/puppet/type/pfile/mode.rb +98 -101
  141. data/lib/puppet/type/pfile/source.rb +228 -209
  142. data/lib/puppet/type/pfile/type.rb +18 -21
  143. data/lib/puppet/type/pfile/uid.rb +127 -130
  144. data/lib/puppet/type/pfilebucket.rb +68 -63
  145. data/lib/puppet/type/schedule.rb +341 -0
  146. data/lib/puppet/type/service.rb +351 -255
  147. data/lib/puppet/type/service/base.rb +9 -14
  148. data/lib/puppet/type/service/debian.rb +32 -38
  149. data/lib/puppet/type/service/init.rb +130 -130
  150. data/lib/puppet/type/service/smf.rb +48 -20
  151. data/lib/puppet/type/state.rb +229 -16
  152. data/lib/puppet/type/symlink.rb +51 -63
  153. data/lib/puppet/type/tidy.rb +105 -102
  154. data/lib/puppet/type/user.rb +118 -180
  155. data/lib/puppet/util.rb +100 -6
  156. data/test/certmgr/certmgr.rb +0 -1
  157. data/test/client/client.rb +4 -4
  158. data/test/executables/puppetbin.rb +7 -14
  159. data/test/executables/puppetca.rb +18 -24
  160. data/test/executables/puppetd.rb +7 -16
  161. data/test/executables/puppetmasterd.rb +7 -9
  162. data/test/executables/puppetmodule.rb +11 -16
  163. data/test/language/ast.rb +11 -7
  164. data/test/language/interpreter.rb +1 -1
  165. data/test/language/scope.rb +2 -0
  166. data/test/language/snippets.rb +30 -5
  167. data/test/language/transportable.rb +77 -0
  168. data/test/other/config.rb +316 -0
  169. data/test/other/events.rb +22 -21
  170. data/test/other/log.rb +14 -14
  171. data/test/other/metrics.rb +4 -8
  172. data/test/other/overrides.rb +5 -5
  173. data/test/other/relationships.rb +4 -2
  174. data/test/other/storage.rb +64 -3
  175. data/test/other/transactions.rb +20 -20
  176. data/test/parser/parser.rb +7 -4
  177. data/test/puppet/conffiles.rb +12 -12
  178. data/test/puppet/defaults.rb +13 -11
  179. data/test/puppet/utiltest.rb +14 -11
  180. data/test/puppettest.rb +156 -48
  181. data/test/server/bucket.rb +2 -2
  182. data/test/server/fileserver.rb +6 -6
  183. data/test/server/logger.rb +19 -11
  184. data/test/server/master.rb +33 -4
  185. data/test/server/server.rb +2 -7
  186. data/test/types/basic.rb +5 -7
  187. data/test/types/component.rb +22 -18
  188. data/test/types/cron.rb +111 -44
  189. data/test/types/exec.rb +116 -59
  190. data/test/types/file.rb +262 -137
  191. data/test/types/filebucket.rb +13 -15
  192. data/test/types/fileignoresource.rb +12 -16
  193. data/test/types/filesources.rb +73 -48
  194. data/test/types/filetype.rb +13 -15
  195. data/test/types/group.rb +15 -13
  196. data/test/types/host.rb +146 -0
  197. data/test/types/package.rb +74 -63
  198. data/test/types/port.rb +139 -0
  199. data/test/types/query.rb +8 -8
  200. data/test/types/schedule.rb +335 -0
  201. data/test/types/service.rb +137 -21
  202. data/test/types/sshkey.rb +140 -0
  203. data/test/types/symlink.rb +3 -5
  204. data/test/types/tidy.rb +5 -14
  205. data/test/types/type.rb +67 -11
  206. data/test/types/user.rb +25 -23
  207. metadata +186 -122
  208. data/lib/puppet/type/pfile/create.rb +0 -108
  209. data/lib/puppet/type/pprocess.rb +0 -97
  210. data/lib/puppet/type/typegen.rb +0 -149
  211. data/lib/puppet/type/typegen/filerecord.rb +0 -243
  212. data/lib/puppet/type/typegen/filetype.rb +0 -316
  213. data/test/other/state.rb +0 -106
@@ -8,51 +8,33 @@
8
8
  # = Usage
9
9
  #
10
10
  # puppetmasterd [-h|--help] [-d|--debug] [-v|--verbose] [-V|--version]
11
- # [-l|--logdest <syslog|console|<file>>] [--httplog <file>]
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 standalone puppet execution script; use it to execute
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
- # autosign::
25
- # Enable autosign (which presents a potential security problem). If enabled,
26
- # refers to the autosign configuration file at /etc/puppet/autosign.conf to
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
- # confdir::
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
- # manifest::
54
- # The central site manifest to use for providing clients with their individual
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
- result = GetoptLong.new(
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[:debug] = true
144
- Puppet[:logdest] = :console
145
- when "--fsconfig"
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[:logdest] = arg
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
- Puppet[:loglevel] = :info
186
- Puppet[:logdest] = :console
141
+ setdest = true
142
+ Puppet::Log.level = :info
143
+ Puppet::Log.newdestination :console
187
144
  else
188
- $stderr.puts "Invalid option '#{opt}'"
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
- if Puppet[:loglevel] == :debug or Puppet[:loglevel] == :info or parseonly
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
- unless fs.include?(:Config)
220
- if File.exists?(Puppet[:fileserverconfig])
221
- fs[:Config] = Puppet[:fileserverconfig]
222
- #else
223
- # Puppet.notice "File server config %s does not exist; skipping file serving" %
224
- # Puppet[:fileserverconfig]
225
- end
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 732 2005-10-28 05:39:59Z luke $
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