puppet 0.13.6 → 0.16.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 +57 -0
- data/Rakefile +38 -410
- data/bin/puppet +14 -12
- data/bin/puppetca +1 -3
- data/bin/puppetd +25 -7
- data/bin/puppetdoc +161 -104
- data/bin/puppetmasterd +4 -4
- data/conf/epm.list +8 -0
- data/conf/redhat/client.init +6 -1
- data/conf/redhat/no-chuser-0.15.1.patch +38 -0
- data/conf/redhat/puppet.spec +20 -5
- data/conf/redhat/puppetd.conf +1 -1
- data/conf/redhat/puppetmasterd.conf +1 -1
- data/conf/redhat/server.init +2 -4
- data/examples/code/snippets/{casestatement → casestatement.pp} +12 -1
- data/examples/code/snippets/selectorvalues.pp +15 -0
- data/examples/code/snippets/singleselector.pp +22 -0
- data/examples/code/snippets/tag.pp +9 -0
- data/ext/module_puppet +1 -1
- data/install.rb +303 -303
- data/lib/puppet.rb +7 -9
- data/lib/puppet/client.rb +18 -5
- data/lib/puppet/client/dipper.rb +12 -10
- data/lib/puppet/client/master.rb +113 -41
- data/lib/puppet/client/pelement.rb +20 -0
- data/lib/puppet/config.rb +113 -6
- data/lib/puppet/element.rb +1 -3
- data/lib/puppet/event.rb +12 -23
- data/lib/puppet/filetype.rb +93 -5
- data/lib/puppet/inifile.rb +201 -0
- data/lib/puppet/log.rb +18 -6
- data/lib/puppet/parameter.rb +80 -29
- data/lib/puppet/parser/ast.rb +6 -4
- data/lib/puppet/parser/ast/caseopt.rb +13 -4
- data/lib/puppet/parser/ast/casestatement.rb +2 -2
- data/lib/puppet/parser/ast/component.rb +4 -14
- data/lib/puppet/parser/ast/hostclass.rb +1 -1
- data/lib/puppet/parser/ast/leaf.rb +12 -0
- data/lib/puppet/parser/ast/node.rb +4 -4
- data/lib/puppet/parser/ast/objectdef.rb +5 -51
- data/lib/puppet/parser/ast/selector.rb +2 -0
- data/lib/puppet/parser/ast/tag.rb +26 -0
- data/lib/puppet/parser/interpreter.rb +89 -74
- data/lib/puppet/parser/lexer.rb +4 -3
- data/lib/puppet/parser/parser.rb +440 -378
- data/lib/puppet/parser/scope.rb +844 -887
- data/lib/puppet/server.rb +12 -1
- data/lib/puppet/server/authconfig.rb +166 -0
- data/lib/puppet/server/authstore.rb +8 -6
- data/lib/puppet/server/ca.rb +23 -26
- data/lib/puppet/server/filebucket.rb +24 -23
- data/lib/puppet/server/fileserver.rb +116 -47
- data/lib/puppet/server/master.rb +58 -19
- data/lib/puppet/server/pelement.rb +176 -0
- data/lib/puppet/server/rights.rb +78 -0
- data/lib/puppet/server/servlet.rb +19 -6
- data/lib/puppet/sslcertificates.rb +4 -2
- data/lib/puppet/sslcertificates/ca.rb +66 -34
- data/lib/puppet/storage.rb +20 -26
- data/lib/puppet/transaction.rb +49 -92
- data/lib/puppet/type.rb +142 -35
- data/lib/puppet/type/cron.rb +29 -14
- data/lib/puppet/type/exec.rb +92 -35
- data/lib/puppet/type/group.rb +29 -11
- data/lib/puppet/type/nameservice.rb +50 -1
- data/lib/puppet/type/nameservice/netinfo.rb +68 -1
- data/lib/puppet/type/nameservice/objectadd.rb +1 -0
- data/lib/puppet/type/package.rb +150 -109
- data/lib/puppet/type/package/apple.rb +27 -0
- data/lib/puppet/type/package/apt.rb +1 -0
- data/lib/puppet/type/package/darwinport.rb +97 -0
- data/lib/puppet/type/package/dpkg.rb +10 -2
- data/lib/puppet/type/package/freebsd.rb +19 -0
- data/lib/puppet/type/package/{bsd.rb → openbsd.rb} +36 -7
- data/lib/puppet/type/package/ports.rb +98 -0
- data/lib/puppet/type/package/rpm.rb +43 -7
- data/lib/puppet/type/package/sun.rb +53 -36
- data/lib/puppet/type/package/yum.rb +5 -16
- data/lib/puppet/type/parsedtype.rb +41 -29
- data/lib/puppet/type/parsedtype/host.rb +13 -5
- data/lib/puppet/type/parsedtype/mount.rb +250 -0
- data/lib/puppet/type/parsedtype/port.rb +8 -6
- data/lib/puppet/type/pfile.rb +284 -30
- data/lib/puppet/type/pfile/checksum.rb +96 -68
- data/lib/puppet/type/pfile/content.rb +16 -13
- data/lib/puppet/type/pfile/ensure.rb +64 -126
- data/lib/puppet/type/pfile/group.rb +12 -5
- data/lib/puppet/type/pfile/mode.rb +16 -4
- data/lib/puppet/type/pfile/source.rb +47 -73
- data/lib/puppet/type/pfile/target.rb +81 -0
- data/lib/puppet/type/pfile/uid.rb +10 -3
- data/lib/puppet/type/pfilebucket.rb +12 -3
- data/lib/puppet/type/schedule.rb +5 -1
- data/lib/puppet/type/service.rb +138 -66
- data/lib/puppet/type/service/debian.rb +9 -3
- data/lib/puppet/type/service/init.rb +51 -56
- data/lib/puppet/type/service/smf.rb +16 -6
- data/lib/puppet/type/state.rb +71 -32
- data/lib/puppet/type/symlink.rb +12 -7
- data/lib/puppet/type/tidy.rb +5 -1
- data/lib/puppet/type/user.rb +116 -20
- data/lib/puppet/type/yumrepo.rb +314 -0
- data/lib/puppet/util.rb +84 -14
- data/test/client/client.rb +41 -18
- data/test/client/master.rb +50 -4
- data/test/executables/puppetbin.rb +31 -4
- data/test/executables/puppetca.rb +18 -2
- data/test/language/ast.rb +201 -31
- data/test/language/interpreter.rb +8 -2
- data/test/{parser → language}/lexer.rb +1 -1
- data/test/language/node.rb +84 -0
- data/test/{parser → language}/parser.rb +1 -1
- data/test/language/scope.rb +101 -2
- data/test/language/snippets.rb +23 -2
- data/test/other/config.rb +99 -1
- data/test/other/filetype.rb +95 -0
- data/test/other/inifile.rb +114 -0
- data/test/other/log.rb +3 -2
- data/test/other/transactions.rb +55 -10
- data/test/puppet/utiltest.rb +25 -1
- data/test/puppettest.rb +140 -46
- data/test/server/authconfig.rb +56 -0
- data/test/server/bucket.rb +32 -18
- data/test/server/fileserver.rb +75 -30
- data/test/server/master.rb +27 -4
- data/test/server/pelement.rb +298 -0
- data/test/server/rights.rb +41 -0
- data/test/server/server.rb +2 -2
- data/test/tagging/tagging.rb +100 -1
- data/test/types/basic.rb +3 -3
- data/test/types/cron.rb +24 -1
- data/test/types/exec.rb +99 -1
- data/test/types/file.rb +298 -2
- data/test/types/filebucket.rb +4 -15
- data/test/types/filesources.rb +43 -14
- data/test/types/group.rb +1 -13
- data/test/types/mount.rb +277 -0
- data/test/types/package.rb +164 -33
- data/test/types/parameter.rb +107 -0
- data/test/types/port.rb +2 -1
- data/test/types/service.rb +37 -2
- data/test/types/state.rb +92 -0
- data/test/types/symlink.rb +30 -2
- data/test/types/tidy.rb +2 -14
- data/test/types/type.rb +35 -1
- data/test/types/user.rb +110 -1
- data/test/types/yumrepo.rb +95 -0
- metadata +316 -290
- data/test/types/filetype.rb +0 -160
data/CHANGELOG
CHANGED
@@ -1,3 +1,60 @@
|
|
1
|
+
0.16.0
|
2
|
+
Added 'tag' keyword/function.
|
3
|
+
|
4
|
+
Added FreeBSD Ports support
|
5
|
+
|
6
|
+
Added 'pelement' server for sending or receiving Puppet objects, although
|
7
|
+
none of the executables use it yet.
|
8
|
+
|
9
|
+
0.15.3
|
10
|
+
Fixed many bugs in :exec, including adding support for arrays of checks
|
11
|
+
|
12
|
+
Added autoloading for types and service variants (e.g., you can now
|
13
|
+
just create a new type in the appropriate location and use it in Puppet,
|
14
|
+
without modifying the core Puppet libs).
|
15
|
+
|
16
|
+
0.15.2
|
17
|
+
Added darwinport, Apple .pkg, and freebsd package types
|
18
|
+
Added 'mount type
|
19
|
+
Host facts are now set at the top scope (Bug #103)
|
20
|
+
Added -e (inline exection) flag to 'puppet' executable
|
21
|
+
Many small bug fixes
|
22
|
+
|
23
|
+
0.15.1
|
24
|
+
Fixed 'yum' installs so that they successfully upgrade packages.
|
25
|
+
Fixed puppetmasterd.conf file so group settings take.
|
26
|
+
|
27
|
+
0.15.0
|
28
|
+
Upped the minor release because the File server is incompatible with 0.14,
|
29
|
+
because it now handles links.
|
30
|
+
|
31
|
+
The 'symlink' type is deprecated (but still present), in favor of using
|
32
|
+
files with the 'target' parameter.
|
33
|
+
|
34
|
+
Unset variables no longer throw an error, they just return an empty string
|
35
|
+
|
36
|
+
You can now specify tags to restrict which objects run during a given run.
|
37
|
+
|
38
|
+
You can also specify to skip running against the cached copy when there's
|
39
|
+
a failure, which is useful for testing new configurations.
|
40
|
+
|
41
|
+
RPMs and Sun packages can now install, as long as they specify a package
|
42
|
+
location, and they'll automatically upgrade if you point them to a new
|
43
|
+
file with an upgrade.
|
44
|
+
Multiple bug fixes.
|
45
|
+
|
46
|
+
|
47
|
+
0.14.1
|
48
|
+
Fixed a couple of small logging bugs
|
49
|
+
Fixed a bug with handling group ownership of links
|
50
|
+
|
51
|
+
0.14.0
|
52
|
+
Added some ability to selectively manage symlinks when doing file management
|
53
|
+
Many bug fixes
|
54
|
+
Variables can now be used as the test values in case statements and selectors
|
55
|
+
Bumping a minor release number because 0.13.4 introduced a protocol
|
56
|
+
incompatibility and should have had a minor rev bump
|
57
|
+
|
1
58
|
0.13.6
|
2
59
|
Many, many small bug fixes
|
3
60
|
FreeBSD user/group support has been added
|
data/Rakefile
CHANGED
@@ -1,436 +1,64 @@
|
|
1
|
-
# -*- ruby -*- (Make emacs happy)
|
2
1
|
# Rakefile for Puppet
|
3
2
|
|
4
3
|
begin
|
5
|
-
require '
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
require 'rake/reductive'
|
5
|
+
rescue LoadError
|
6
|
+
$stderr.puts "You must have the Reductive build library in your RUBYLIB."
|
7
|
+
exit(14)
|
9
8
|
end
|
10
9
|
|
11
|
-
|
12
|
-
begin
|
13
|
-
require 'rdoc/rdoc'
|
14
|
-
rescue => detail
|
15
|
-
$rdoc = false
|
16
|
-
puts "No rdoc: %s" % detail
|
17
|
-
end
|
18
|
-
require 'rake/clean'
|
19
|
-
require 'rake/testtask'
|
20
|
-
|
21
|
-
if $rdoc
|
22
|
-
require 'rake/rdoctask'
|
23
|
-
end
|
24
|
-
CLEAN.include('**/*.o')
|
25
|
-
CLOBBER.include('doc/*')
|
26
|
-
|
27
|
-
def announce(msg='')
|
28
|
-
STDERR.puts msg
|
29
|
-
end
|
10
|
+
TESTHOSTS = %w{rh3a fedora1 centos1 freebsd1 culain}
|
30
11
|
|
31
|
-
|
12
|
+
project = Rake::RedLabProject.new("puppet") do |p|
|
13
|
+
p.summary = "System Automation and Configuration Management Software"
|
14
|
+
p.description = "Puppet is a declarative language for expressing system
|
15
|
+
configuration, a client and server for distributing it, and a library
|
16
|
+
for realizing the configuration."
|
32
17
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
end
|
18
|
+
p.filelist = [
|
19
|
+
'install.rb',
|
20
|
+
'[A-Z]*',
|
21
|
+
'lib/**/*.rb',
|
22
|
+
'test/**/*.rb',
|
23
|
+
'bin/**/*',
|
24
|
+
'ext/**/*',
|
25
|
+
'examples/**/*',
|
26
|
+
'conf/**/*'
|
27
|
+
]
|
44
28
|
|
45
|
-
|
46
|
-
|
47
|
-
if ENV['HOSTS']
|
48
|
-
TESTHOSTS = ENV['HOSTS'].split(/\s+/)
|
49
|
-
else
|
50
|
-
TESTHOSTS = %w{fedora1 rh3a culain openbsd1 centos1}
|
29
|
+
p.add_dependency('facter', '1.1.0')
|
51
30
|
end
|
52
|
-
#TESTHOSTS = %w{sol10b}
|
53
|
-
|
54
|
-
# The default task is run if rake is given no explicit arguments.
|
55
|
-
|
56
|
-
desc "Default Task"
|
57
|
-
task :default => :alltests
|
58
31
|
|
59
|
-
|
32
|
+
if project.has?(:gem)
|
33
|
+
# Make our gem task. This actually just fills out the spec.
|
34
|
+
project.mkgemtask do |task|
|
60
35
|
|
61
|
-
task
|
62
|
-
task :a => :alltests
|
36
|
+
task.require_path = 'lib' # Use these for libraries.
|
63
37
|
|
64
|
-
task
|
65
|
-
|
66
|
-
end
|
67
|
-
|
68
|
-
#Rake::TestTask.new(:alltests) do |t|
|
69
|
-
# t.test_files = FileList['test/*/*.rb']
|
70
|
-
# t.warning = true
|
71
|
-
# t.verbose = false
|
72
|
-
#end
|
73
|
-
|
74
|
-
#Rake::TestTask.new(:unittests) do |t|
|
75
|
-
# t.test_files = FileList['test/test']
|
76
|
-
# t.warning = true
|
77
|
-
# t.verbose = false
|
78
|
-
#end
|
79
|
-
|
80
|
-
# SVN Tasks ----------------------------------------------------------
|
81
|
-
# ... none.
|
82
|
-
|
83
|
-
# Install rake using the standard install.rb script.
|
84
|
-
|
85
|
-
desc "Install the application"
|
86
|
-
task :install do
|
87
|
-
ruby "install.rb"
|
88
|
-
end
|
89
|
-
|
90
|
-
# Create a task to build the RDOC documentation tree.
|
91
|
-
|
92
|
-
#Rake::RDocTask.new("ri") { |rdoc|
|
93
|
-
# #rdoc.rdoc_dir = 'html'
|
94
|
-
# #rdoc.template = 'html'
|
95
|
-
# rdoc.title = "Puppet"
|
96
|
-
# rdoc.options << '--ri' << '--line-numbers' << '--inline-source' << '--main' << 'README'
|
97
|
-
# rdoc.rdoc_files.include('README', 'LICENSE', 'TODO', 'CHANGELOG')
|
98
|
-
# rdoc.rdoc_files.include('lib/**/*.rb', 'doc/**/*.rdoc')
|
99
|
-
#}
|
100
|
-
|
101
|
-
if $rdoc
|
102
|
-
Rake::RDocTask.new(:html) { |rdoc|
|
103
|
-
rdoc.rdoc_dir = 'html'
|
104
|
-
rdoc.template = 'html'
|
105
|
-
rdoc.title = "Puppet"
|
106
|
-
rdoc.options << '--line-numbers' << '--inline-source' << '--main' << 'README'
|
107
|
-
rdoc.rdoc_files.include('README', 'LICENSE', 'TODO', 'CHANGELOG')
|
108
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
109
|
-
CLEAN.include("html")
|
110
|
-
}
|
111
|
-
end
|
112
|
-
|
113
|
-
if $rdoc
|
114
|
-
task :ri do |ri|
|
115
|
-
files = ['README', 'LICENSE', 'TODO', 'CHANGELOG'] + Dir.glob('lib/**/*.rb')
|
116
|
-
puts "files are \n%s" % files.join("\n")
|
117
|
-
begin
|
118
|
-
ri = RDoc::RDoc.new
|
119
|
-
ri.document(["--ri-site"] + files)
|
120
|
-
rescue RDoc::RDocError => detail
|
121
|
-
puts "Failed to build docs: %s" % detail
|
122
|
-
return nil
|
123
|
-
rescue LoadError
|
124
|
-
puts "Missing rdoc; cannot build documentation"
|
125
|
-
return nil
|
126
|
-
end
|
127
|
-
end
|
128
|
-
end
|
129
|
-
|
130
|
-
# ====================================================================
|
131
|
-
# Create a task that will package the Rake software into distributable
|
132
|
-
# tar, zip and gem files.
|
133
|
-
|
134
|
-
PKG_FILES = FileList[
|
135
|
-
'install.rb',
|
136
|
-
'[A-Z]*',
|
137
|
-
'lib/**/*.rb',
|
138
|
-
'test/**/*.rb',
|
139
|
-
'bin/**/*',
|
140
|
-
'ext/**/*',
|
141
|
-
'examples/**/*',
|
142
|
-
'conf/**/*'
|
143
|
-
]
|
144
|
-
PKG_FILES.delete_if {|item| item.include?(".svn")}
|
145
|
-
|
146
|
-
if ! defined?(Gem)
|
147
|
-
puts "Package Target requires RubyGEMs"
|
148
|
-
else
|
149
|
-
spec = Gem::Specification.new { |s|
|
150
|
-
|
151
|
-
#### Basic information.
|
152
|
-
|
153
|
-
s.name = 'puppet'
|
154
|
-
s.version = PKG_VERSION
|
155
|
-
s.summary = "Puppet is a server configuration management tool."
|
156
|
-
s.description = <<-EOF
|
157
|
-
Puppet is a declarative language for expressing system configuration,
|
158
|
-
a client and server for distributing it, and a library for realizing
|
159
|
-
the configuration.
|
160
|
-
EOF
|
161
|
-
s.platform = Gem::Platform::RUBY
|
162
|
-
|
163
|
-
#### Dependencies and requirements.
|
164
|
-
|
165
|
-
# I'd love to explicitly list all of the libraries that I need,
|
166
|
-
# but gems seem to only be able to handle dependencies on other
|
167
|
-
# gems, which is, um, stupid.
|
168
|
-
s.add_dependency('facter', '>= 1.1.0')
|
169
|
-
#s.requirements << ""
|
170
|
-
|
171
|
-
s.files = PKG_FILES.to_a
|
172
|
-
|
173
|
-
#### Load-time details: library and application (you will need one or both).
|
174
|
-
|
175
|
-
s.require_path = 'lib' # Use these for libraries.
|
176
|
-
|
177
|
-
s.bindir = "bin" # Use these for applications.
|
178
|
-
s.executables = ["puppet", "puppetd", "puppetmasterd", "puppetdoc",
|
38
|
+
task.bindir = "bin" # Use these for applications.
|
39
|
+
task.executables = ["puppet", "puppetd", "puppetmasterd", "puppetdoc",
|
179
40
|
"puppetca"]
|
180
|
-
|
181
|
-
|
41
|
+
task.default_executable = "puppet"
|
42
|
+
task.autorequire = 'puppet'
|
182
43
|
|
183
44
|
#### Documentation and testing.
|
184
45
|
|
185
|
-
|
46
|
+
task.has_rdoc = true
|
186
47
|
#s.extra_rdoc_files = rd.rdoc_files.reject { |fn| fn =~ /\.rb$/ }.to_a
|
187
|
-
|
48
|
+
task.rdoc_options <<
|
188
49
|
'--title' << 'Puppet - Configuration Management' <<
|
189
50
|
'--main' << 'README' <<
|
190
51
|
'--line-numbers'
|
191
|
-
|
192
|
-
|
193
|
-
#### Signing key and cert chain
|
194
|
-
#s.signing_key = '/..../gem-private_key.pem'
|
195
|
-
#s.cert_chain = ['gem-public_cert.pem']
|
196
|
-
|
197
|
-
#### Author and project details.
|
198
|
-
|
199
|
-
s.author = "Luke Kanies"
|
200
|
-
s.email = "dev@reductivelabs.com"
|
201
|
-
s.homepage = "http://reductivelabs.com/projects/puppet"
|
202
|
-
s.rubyforge_project = "puppet"
|
203
|
-
}
|
204
|
-
|
205
|
-
Rake::GemPackageTask.new(spec) { |pkg|
|
206
|
-
#pkg.need_zip = true
|
207
|
-
pkg.need_tar = true
|
208
|
-
}
|
209
|
-
CLEAN.include("pkg")
|
210
|
-
end
|
211
|
-
|
212
|
-
# Misc tasks =========================================================
|
213
|
-
|
214
|
-
#ARCHIVEDIR = '/tmp'
|
215
|
-
|
216
|
-
#task :archive => [:package] do
|
217
|
-
# cp FileList["pkg/*.tgz", "pkg/*.zip", "pkg/*.gem"], ARCHIVEDIR
|
218
|
-
#end
|
219
|
-
|
220
|
-
# Define an optional publish target in an external file. If the
|
221
|
-
# publish.rf file is not found, the publish targets won't be defined.
|
222
|
-
|
223
|
-
#load "publish.rf" if File.exist? "publish.rf"
|
224
|
-
|
225
|
-
# Support Tasks ------------------------------------------------------
|
226
|
-
|
227
|
-
def egrep(pattern)
|
228
|
-
Dir['**/*.rb'].each do |fn|
|
229
|
-
count = 0
|
230
|
-
open(fn) do |f|
|
231
|
-
while line = f.gets
|
232
|
-
count += 1
|
233
|
-
if line =~ pattern
|
234
|
-
puts "#{fn}:#{count}:#{line}"
|
235
|
-
end
|
236
|
-
end
|
237
|
-
end
|
238
|
-
end
|
239
|
-
end
|
240
|
-
|
241
|
-
desc "Look for TODO and FIXME tags in the code"
|
242
|
-
task :todo do
|
243
|
-
egrep "/#.*(FIXME|TODO|TBD)/"
|
244
|
-
end
|
245
|
-
|
246
|
-
#desc "Look for Debugging print lines"
|
247
|
-
#task :dbg do
|
248
|
-
# egrep /\bDBG|\bbreakpoint\b/
|
249
|
-
#end
|
250
|
-
|
251
|
-
#desc "List all ruby files"
|
252
|
-
#task :rubyfiles do
|
253
|
-
# puts Dir['**/*.rb'].reject { |fn| fn =~ /^pkg/ }
|
254
|
-
# puts Dir['**/bin/*'].reject { |fn| fn =~ /svn|(~$)|(\.rb$)/ }
|
255
|
-
#end
|
256
|
-
|
257
|
-
# --------------------------------------------------------------------
|
258
|
-
# Creating a release
|
259
|
-
|
260
|
-
desc "Make a new release"
|
261
|
-
task :release => [
|
262
|
-
:prerelease,
|
263
|
-
:clobber,
|
264
|
-
:update_version,
|
265
|
-
:tag, # tag everything before we make a bunch of extra dirs
|
266
|
-
:html,
|
267
|
-
:package,
|
268
|
-
:fedorarpm,
|
269
|
-
:copy
|
270
|
-
] do
|
271
|
-
|
272
|
-
announce
|
273
|
-
announce "**************************************************************"
|
274
|
-
announce "* Release #{PKG_VERSION} Complete."
|
275
|
-
announce "* Packages ready to upload."
|
276
|
-
announce "**************************************************************"
|
277
|
-
announce
|
278
|
-
end
|
279
|
-
|
280
|
-
# Validate that everything is ready to go for a release.
|
281
|
-
task :prerelease do
|
282
|
-
announce
|
283
|
-
announce "**************************************************************"
|
284
|
-
announce "* Making RubyGem Release #{PKG_VERSION}"
|
285
|
-
announce "* (current version #{CURRENT_VERSION})"
|
286
|
-
announce "**************************************************************"
|
287
|
-
announce
|
288
|
-
|
289
|
-
# Is a release number supplied?
|
290
|
-
unless ENV['REL']
|
291
|
-
fail "Usage: rake release REL=x.y.z [REUSE=tag_suffix]"
|
292
|
-
end
|
293
|
-
|
294
|
-
# Is the release different than the current release.
|
295
|
-
# (or is REUSE set?)
|
296
|
-
if PKG_VERSION == CURRENT_VERSION && ! ENV['REUSE']
|
297
|
-
fail "Current version is #{PKG_VERSION}, must specify REUSE=tag_suffix to reuse version"
|
298
|
-
end
|
299
|
-
|
300
|
-
# Are all source files checked in?
|
301
|
-
if ENV['RELTEST']
|
302
|
-
announce "Release Task Testing, skipping checked-in file test"
|
303
|
-
else
|
304
|
-
announce "Checking for unchecked-in files..."
|
305
|
-
data = `svn -q update`
|
306
|
-
unless data =~ /^$/
|
307
|
-
fail "SVN update is not clean ... do you have unchecked-in files?"
|
308
|
-
end
|
309
|
-
announce "No outstanding checkins found ... OK"
|
310
|
-
end
|
311
|
-
end
|
312
|
-
|
313
|
-
task :update_version => [:prerelease] do
|
314
|
-
if PKG_VERSION == CURRENT_VERSION
|
315
|
-
announce "No version change ... skipping version update"
|
316
|
-
else
|
317
|
-
announce "Updating Puppet version to #{PKG_VERSION}"
|
318
|
-
open("lib/puppet.rb") do |rakein|
|
319
|
-
open("lib/puppet.rb.new", "w") do |rakeout|
|
320
|
-
rakein.each do |line|
|
321
|
-
if line =~ /^(\s*)PUPPETVERSION\s*=\s*/
|
322
|
-
rakeout.puts "#{$1}PUPPETVERSION = '#{PKG_VERSION}'"
|
323
|
-
else
|
324
|
-
rakeout.puts line
|
325
|
-
end
|
326
|
-
end
|
327
|
-
end
|
328
|
-
end
|
329
|
-
mv "lib/puppet.rb.new", "lib/puppet.rb"
|
330
|
-
|
331
|
-
open("conf/redhat/puppet.spec") do |rakein|
|
332
|
-
open("conf/redhat/puppet.spec.new", "w") do |rakeout|
|
333
|
-
rakein.each do |line|
|
334
|
-
if line =~ /^Version:\s*/
|
335
|
-
rakeout.puts "Version: #{PKG_VERSION}"
|
336
|
-
elsif line =~ /^Release:\s*/
|
337
|
-
rakeout.puts "Release: 1%{?dist}"
|
338
|
-
else
|
339
|
-
rakeout.puts line
|
340
|
-
end
|
341
|
-
end
|
342
|
-
end
|
343
|
-
end
|
344
|
-
mv "conf/redhat/puppet.spec.new", "conf/redhat/puppet.spec"
|
345
|
-
|
346
|
-
if ENV['RELTEST']
|
347
|
-
announce "Release Task Testing, skipping commiting of new version"
|
348
|
-
else
|
349
|
-
sh %{svn commit -m "Updated to version #{PKG_VERSION}" lib/puppet.rb conf/redhat/puppet.spec}
|
350
|
-
end
|
52
|
+
task.test_file = "test/test"
|
351
53
|
end
|
352
54
|
end
|
353
55
|
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
sh %{cp pkg/puppet-#{PKG_VERSION}.tgz #{DOWNDIR}/puppet}
|
360
|
-
sh %{ln -sf puppet-#{PKG_VERSION}.tgz #{DOWNDIR}/puppet/puppet-latest.tgz}
|
361
|
-
sh %{cp -r html #{DOWNDIR}/puppet/apidocs}
|
362
|
-
sh %{rsync -av /home/luke/rpm/. #{DOWNDIR}/rpm}
|
363
|
-
end
|
364
|
-
|
365
|
-
desc "Tag all the SVN files with the latest release number (REL=x.y.z)"
|
366
|
-
task :tag => [:prerelease] do
|
367
|
-
reltag = "REL_#{PKG_VERSION.gsub(/\./, '_')}"
|
368
|
-
reltag << ENV['REUSE'].gsub(/\./, '_') if ENV['REUSE']
|
369
|
-
announce "Tagging SVN copy with [#{reltag}]"
|
370
|
-
if ENV['RELTEST']
|
371
|
-
announce "Release Task Testing, skipping SVN tagging"
|
372
|
-
else
|
373
|
-
sh %{svn copy ../trunk/ ../tags/#{reltag}}
|
374
|
-
sh %{cd ../tags; svn ci -m "Adding release tag #{reltag}"}
|
375
|
-
end
|
376
|
-
end
|
377
|
-
|
378
|
-
desc "Test Puppet on each test host"
|
379
|
-
task :hosttest do
|
380
|
-
out = ""
|
381
|
-
TESTHOSTS.each { |host|
|
382
|
-
puts "testing %s" % host
|
383
|
-
cwd = Dir.getwd
|
384
|
-
out += %x{ssh #{host} 'cd puppet/test; sudo ./test' 2>&1}
|
385
|
-
|
386
|
-
if $? != 0
|
387
|
-
file = File.join("/tmp", "%stest.out" % host)
|
388
|
-
File.open(file, "w") { |of| of.print out }
|
389
|
-
puts out
|
390
|
-
puts "%s failed; output is in %s" % [host, file]
|
391
|
-
end
|
392
|
-
#sh %{ssh #{host} 'cd #{cwd}/test; sudo ./test' 2>&1}
|
393
|
-
}
|
394
|
-
|
395
|
-
#IO.popen("mail -s 'Puppet Test Results' luke@madstop.com") do |m|
|
396
|
-
# m.puts out
|
397
|
-
#end
|
398
|
-
end
|
399
|
-
|
400
|
-
desc "Create an RPM"
|
401
|
-
task :rpm do
|
402
|
-
tarball = File.join(Dir.getwd, "pkg", "puppet-#{PKG_VERSION}.tgz")
|
403
|
-
|
404
|
-
sourcedir = `rpm --define 'name puppet' --define 'version #{PKG_VERSION}' --eval '%_sourcedir'`.chomp
|
405
|
-
specdir = `rpm --define 'name puppet' --define 'version #{PKG_VERSION}' --eval '%_specdir'`.chomp
|
406
|
-
basedir = File.dirname(sourcedir)
|
407
|
-
|
408
|
-
if ! FileTest::exist?(sourcedir)
|
409
|
-
FileUtils.mkdir_p(sourcedir)
|
410
|
-
end
|
411
|
-
FileUtils.mkdir_p(basedir)
|
412
|
-
|
413
|
-
target = "#{sourcedir}/#{File::basename(tarball)}"
|
414
|
-
|
415
|
-
sh %{cp %s %s} % [tarball, target]
|
416
|
-
sh %{cp conf/redhat/puppet.spec %s/puppet.spec} % basedir
|
417
|
-
|
418
|
-
Dir.chdir(basedir) do
|
419
|
-
sh %{rpmbuild -ba puppet.spec}
|
56
|
+
if project.has?(:epm)
|
57
|
+
project.mkepmtask do |task|
|
58
|
+
task.bins = FileList.new("bin/puppet", "bin/puppetca")
|
59
|
+
task.sbins = FileList.new("bin/puppetmasterd", "bin/puppetd")
|
60
|
+
task.rubylibs = FileList.new('lib/**/*')
|
420
61
|
end
|
421
|
-
|
422
|
-
sh %{mv %s/puppet.spec %s} % [basedir, specdir]
|
423
|
-
end
|
424
|
-
|
425
|
-
desc "Create an rpm on a system that can actually do so"
|
426
|
-
task :fedorarpm => [:package] do
|
427
|
-
sh %{ssh fedora1 'cd puppet; rake rpm'}
|
428
|
-
end
|
429
|
-
|
430
|
-
desc "Create a Native Package"
|
431
|
-
task :nativepkg do
|
432
|
-
# Okay, first we get a file list
|
433
|
-
|
434
62
|
end
|
435
63
|
|
436
|
-
# $Id$
|
64
|
+
# $Id: Rakefile 1079 2006-04-05 06:54:13Z luke $
|