diff options
-rw-r--r-- | .gitignore | 6 | ||||
-rw-r--r-- | 0001-4922-Don-t-truncate-remotely-sourced-files-on-404.patch | 273 | ||||
-rw-r--r-- | 0001-5073-Download-plugins-even-if-you-re-filtering-on-ta.patch | 123 | ||||
-rw-r--r-- | 0001-5428-More-fully-stub-Puppet-Resource-Reference-for-u.patch | 182 | ||||
-rw-r--r-- | puppet-0.25.5.tar.gz.sign | 17 | ||||
-rw-r--r-- | puppet-2.6.6.tar.gz.sign | 17 | ||||
-rw-r--r-- | puppet.spec | 80 | ||||
-rw-r--r-- | sources | 2 |
8 files changed, 668 insertions, 32 deletions
@@ -1 +1,5 @@ -puppet-0.25.5.tar.gz +*~ +*.rpm +*.tar.gz +/.build*.log +/puppet-*/ diff --git a/0001-4922-Don-t-truncate-remotely-sourced-files-on-404.patch b/0001-4922-Don-t-truncate-remotely-sourced-files-on-404.patch new file mode 100644 index 0000000..1b4f1ce --- /dev/null +++ b/0001-4922-Don-t-truncate-remotely-sourced-files-on-404.patch @@ -0,0 +1,273 @@ +From 743e03930758d17ed35fc6b73f7c2c68d8212137 Mon Sep 17 00:00:00 2001 +From: Nick Lewis <nick@puppetlabs.com> +Date: Mon, 28 Feb 2011 13:40:18 -0800 +Subject: [PATCH/puppet] (#4922) Don't truncate remotely-sourced files on 404 + +We were 'handling' 404's on remote file content retrieval by returning nil +rather than raising an exception. This caused no content to be written to the +temporary file, but still appeared successful, so the destination file was +overwritten, instead of preserved. Now we just handle 404 like any other +error. + +Note that the root cause of these 404s seems to have been #4319, which has been +fixed. However, in the event we do happen to get a 404 here, it's better not to +have code to specifically handle it incorrectly. + +Paired-With: Max Martin +Reviewed-By: Matt Robinson +--- + lib/puppet/type/file/content.rb | 1 - + spec/unit/type/file/content_spec.rb | 175 ++++++++--------------------------- + 2 files changed, 38 insertions(+), 138 deletions(-) + +diff --git a/lib/puppet/type/file/content.rb b/lib/puppet/type/file/content.rb +index 63c0aaf..1b36acb 100755 +--- a/lib/puppet/type/file/content.rb ++++ b/lib/puppet/type/file/content.rb +@@ -194,7 +194,6 @@ module Puppet + connection = Puppet::Network::HttpPool.http_instance(source_or_content.server, source_or_content.port) + connection.request_get(indirection2uri(request), add_accept_encoding({"Accept" => "raw"})) do |response| + case response.code +- when "404"; nil + when /^2/; uncompress(response) { |uncompressor| response.read_body { |chunk| yield uncompressor.uncompress(chunk) } } + else + # Raise the http error if we didn't get a 'success' of some kind. +diff --git a/spec/unit/type/file/content_spec.rb b/spec/unit/type/file/content_spec.rb +index 9178c94..7d23399 100755 +--- a/spec/unit/type/file/content_spec.rb ++++ b/spec/unit/type/file/content_spec.rb +@@ -4,15 +4,14 @@ Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f + + content = Puppet::Type.type(:file).attrclass(:content) + describe content do ++ include PuppetSpec::Files + before do +- @resource = Puppet::Type.type(:file).new :path => "/foo/bar" ++ @filename = tmpfile('testfile') ++ @resource = Puppet::Type.type(:file).new :path => @filename ++ File.open(@filename, 'w') {|f| f.write "initial file content"} + content.stubs(:standalone?).returns(false) + end + +- it "should be a subclass of Property" do +- content.superclass.must == Puppet::Property +- end +- + describe "when determining the checksum type" do + it "should use the type specified in the source checksum if a source is set" do + @resource[:source] = "/foo" +@@ -249,10 +248,10 @@ describe content do + describe "when writing" do + before do + @content = content.new(:resource => @resource) +- @fh = stub_everything + end + + it "should attempt to read from the filebucket if no actual content nor source exists" do ++ @fh = File.open(@filename, 'w') + @content.should = "{md5}foo" + @content.resource.bucket.class.any_instance.stubs(:getfile).returns "foo" + @content.write(@fh) +@@ -302,166 +301,68 @@ describe content do + + describe "from local source" do + before(:each) do +- @content.stubs(:actual_content).returns(nil) +- @source = stub_everything 'source', :local? => true, :full_path => "/path/to/source" +- @resource.stubs(:parameter).with(:source).returns @source +- +- @sum = stub_everything 'sum' +- @resource.stubs(:parameter).with(:checksum).returns(@sum) +- +- @digest = stub_everything 'digest' +- @sum.stubs(:sum_stream).yields(@digest) +- +- @file = stub_everything 'file' +- File.stubs(:open).yields(@file) +- @file.stubs(:read).with(8192).returns("chunk1").then.returns("chunk2").then.returns(nil) +- end +- +- it "should open the local file" do +- File.expects(:open).with("/path/to/source", "r") +- @content.write(@fh) +- end ++ @resource = Puppet::Type.type(:file).new :path => @filename, :backup => false ++ @sourcename = tmpfile('source') ++ @source_content = "source file content"*10000 ++ @sourcefile = File.open(@sourcename, 'w') {|f| f.write @source_content} + +- it "should read the local file by chunks" do +- @file.expects(:read).with(8192).returns("chunk1").then.returns(nil) +- @content.write(@fh) ++ @content = @resource.newattr(:content) ++ @source = @resource.newattr(:source) ++ @source.stubs(:metadata).returns stub_everything('metadata', :source => @sourcename, :ftype => 'file') + end + +- it "should write each chunk to the file" do +- @fh.expects(:print).with("chunk1").then.with("chunk2") +- @content.write(@fh) +- end +- +- it "should pass each chunk to the current sum stream" do +- @digest.expects(:<<).with("chunk1").then.with("chunk2") +- @content.write(@fh) ++ it "should copy content from the source to the file" do ++ @resource.write(@source) ++ File.read(@filename).should == @source_content + end + + it "should return the checksum computed" do +- @sum.stubs(:sum_stream).yields(@digest).returns("checksum") +- @content.write(@fh).should == "checksum" ++ File.open(@filename, 'w') do |file| ++ @content.write(file).should == "{md5}#{Digest::MD5.hexdigest(@source_content)}" ++ end + end + end + + describe "from remote source" do + before(:each) do +- @response = stub_everything 'mock response', :code => "404" ++ @resource = Puppet::Type.type(:file).new :path => @filename, :backup => false ++ @response = stub_everything 'response', :code => "200" ++ @source_content = "source file content"*10000 ++ @response.stubs(:read_body).multiple_yields(*(["source file content"]*10000)) ++ + @conn = stub_everything 'connection' + @conn.stubs(:request_get).yields(@response) + Puppet::Network::HttpPool.stubs(:http_instance).returns @conn + +- @content.stubs(:actual_content).returns(nil) +- @source = stub_everything 'source', :local? => false, :full_path => "/path/to/source", :server => "server", :port => 1234 +- @resource.stubs(:parameter).with(:source).returns @source +- +- @sum = stub_everything 'sum' +- @resource.stubs(:parameter).with(:checksum).returns(@sum) +- +- @digest = stub_everything 'digest' +- @sum.stubs(:sum_stream).yields(@digest) +- end +- +- it "should open a network connection to source server and port" do +- Puppet::Network::HttpPool.expects(:http_instance).with("server", 1234).returns @conn +- @content.write(@fh) +- end +- +- it "should send the correct indirection uri" do +- @conn.expects(:request_get).with { |uri,headers| uri == "/production/file_content/path/to/source" }.yields(@response) +- @content.write(@fh) ++ @content = @resource.newattr(:content) ++ @sourcename = "puppet:///test/foo" ++ @source = @resource.newattr(:source) ++ @source.stubs(:metadata).returns stub_everything('metadata', :source => @sourcename, :ftype => 'file') + end + +- it "should return nil if source is not found" do +- @response.expects(:code).returns("404") +- @content.write(@fh).should == nil ++ it "should write the contents to the file" do ++ @resource.write(@source) ++ File.read(@filename).should == @source_content + end + + it "should not write anything if source is not found" do +- @response.expects(:code).returns("404") +- @fh.expects(:print).never +- @content.write(@fh).should == nil ++ @response.stubs(:code).returns("404") ++ lambda {@resource.write(@source)}.should raise_error(Net::HTTPError) { |e| e.message =~ /404/ } ++ File.read(@filename).should == "initial file content" + end + + it "should raise an HTTP error in case of server error" do +- @response.expects(:code).returns("500") +- lambda { @content.write(@fh) }.should raise_error +- end +- +- it "should write content by chunks" do +- @response.expects(:code).returns("200") +- @response.expects(:read_body).multiple_yields("chunk1","chunk2") +- @fh.expects(:print).with("chunk1").then.with("chunk2") +- @content.write(@fh) +- end +- +- it "should pass each chunk to the current sum stream" do +- @response.expects(:code).returns("200") +- @response.expects(:read_body).multiple_yields("chunk1","chunk2") +- @digest.expects(:<<).with("chunk1").then.with("chunk2") +- @content.write(@fh) ++ @response.stubs(:code).returns("500") ++ lambda { @content.write(@fh) }.should raise_error { |e| e.message.include? @source_content } + end + + it "should return the checksum computed" do +- @response.expects(:code).returns("200") +- @response.expects(:read_body).multiple_yields("chunk1","chunk2") +- @sum.expects(:sum_stream).yields(@digest).returns("checksum") +- @content.write(@fh).should == "checksum" +- end +- +- it "should get the current accept encoding header value" do +- @content.expects(:add_accept_encoding) +- @content.write(@fh) +- end +- +- it "should uncompress body on error" do +- @response.expects(:code).returns("500") +- @response.expects(:body).returns("compressed body") +- @content.expects(:uncompress_body).with(@response).returns("uncompressed") +- lambda { @content.write(@fh) }.should raise_error { |e| e.message =~ /uncompressed/ } +- end +- +- it "should uncompress chunk by chunk" do +- uncompressor = stub_everything 'uncompressor' +- @content.expects(:uncompress).with(@response).yields(uncompressor) +- @response.expects(:code).returns("200") +- @response.expects(:read_body).multiple_yields("chunk1","chunk2") +- +- uncompressor.expects(:uncompress).with("chunk1").then.with("chunk2") +- @content.write(@fh) +- end +- +- it "should write uncompressed chunks to the file" do +- uncompressor = stub_everything 'uncompressor' +- @content.expects(:uncompress).with(@response).yields(uncompressor) +- @response.expects(:code).returns("200") +- @response.expects(:read_body).multiple_yields("chunk1","chunk2") +- +- uncompressor.expects(:uncompress).with("chunk1").returns("uncompressed1") +- uncompressor.expects(:uncompress).with("chunk2").returns("uncompressed2") +- +- @fh.expects(:print).with("uncompressed1") +- @fh.expects(:print).with("uncompressed2") +- +- @content.write(@fh) +- end +- +- it "should pass each uncompressed chunk to the current sum stream" do +- uncompressor = stub_everything 'uncompressor' +- @content.expects(:uncompress).with(@response).yields(uncompressor) +- @response.expects(:code).returns("200") +- @response.expects(:read_body).multiple_yields("chunk1","chunk2") +- +- uncompressor.expects(:uncompress).with("chunk1").returns("uncompressed1") +- uncompressor.expects(:uncompress).with("chunk2").returns("uncompressed2") +- +- @digest.expects(:<<).with("uncompressed1").then.with("uncompressed2") +- @content.write(@fh) ++ File.open(@filename, 'w') do |file| ++ @content.write(file).should == "{md5}#{Digest::MD5.hexdigest(@source_content)}" ++ end + end + end + +- describe "from a filebucket" do +- end +- + # These are testing the implementation rather than the desired behaviour; while that bites, there are a whole + # pile of other methods in the File type that depend on intimate details of this implementation and vice-versa. + # If these blow up, you are gonna have to review the callers to make sure they don't explode! --daniel 2011-02-01 +-- +1.7.4.1 + diff --git a/0001-5073-Download-plugins-even-if-you-re-filtering-on-ta.patch b/0001-5073-Download-plugins-even-if-you-re-filtering-on-ta.patch new file mode 100644 index 0000000..3501750 --- /dev/null +++ b/0001-5073-Download-plugins-even-if-you-re-filtering-on-ta.patch @@ -0,0 +1,123 @@ +From 852fb9744320c253772c85e52b262b0290fb7dd4 Mon Sep 17 00:00:00 2001 +From: Matt Robinson <matt@puppetlabs.com> +Date: Tue, 15 Mar 2011 16:13:15 -0700 +Subject: [PATCH/puppet] (#5073) Download plugins even if you're filtering on tags + +When we eval a resource in transaction.rb it was being skipped when +filtering on tags and downloading the plugins. There's a lot of +complicated conditions for whether to skip a resource, but this is a +condensed version of the path that was causing plugins not to be +downloaded. + + skip? + missing_tags? + !ignore_tags? + !host_config + +The Puppet::Configurer::Downloader creates separate catalogs and applies them +to get custom facts and plugins, so should be setting host_config to false. +Puppet::Util::Settings also sets host_config to false when you call use on +settings, while normal catalog application defaults to true. + +Thanks to Stefan Schulte <stefan.schulte@taunusstein.net> for suggesting +the implementation fix. +--- + lib/puppet/configurer/downloader.rb | 1 + + lib/puppet/configurer/plugin_handler.rb | 9 +++++++- + spec/unit/configurer/downloader_spec.rb | 32 +++++++++++++++++++++--------- + 3 files changed, 31 insertions(+), 11 deletions(-) + +diff --git a/lib/puppet/configurer/downloader.rb b/lib/puppet/configurer/downloader.rb +index 1b587ed..b369620 100644 +--- a/lib/puppet/configurer/downloader.rb ++++ b/lib/puppet/configurer/downloader.rb +@@ -50,6 +50,7 @@ class Puppet::Configurer::Downloader + + def catalog + catalog = Puppet::Resource::Catalog.new ++ catalog.host_config = false + catalog.add_resource(file) + catalog + end +diff --git a/lib/puppet/configurer/plugin_handler.rb b/lib/puppet/configurer/plugin_handler.rb +index cfc6b5a..ae088f2 100644 +--- a/lib/puppet/configurer/plugin_handler.rb ++++ b/lib/puppet/configurer/plugin_handler.rb +@@ -9,7 +9,14 @@ module Puppet::Configurer::PluginHandler + # Retrieve facts from the central server. + def download_plugins + return nil unless download_plugins? +- Puppet::Configurer::Downloader.new("plugin", Puppet[:plugindest], Puppet[:pluginsource], Puppet[:pluginsignore]).evaluate.each { |file| load_plugin(file) } ++ plugin_downloader = Puppet::Configurer::Downloader.new( ++ "plugin", ++ Puppet[:plugindest], ++ Puppet[:pluginsource], ++ Puppet[:pluginsignore] ++ ) ++ ++ plugin_downloader.evaluate.each { |file| load_plugin(file) } + end + + def load_plugin(file) +diff --git a/spec/unit/configurer/downloader_spec.rb b/spec/unit/configurer/downloader_spec.rb +index c57f39f..4080263 100755 +--- a/spec/unit/configurer/downloader_spec.rb ++++ b/spec/unit/configurer/downloader_spec.rb +@@ -5,6 +5,8 @@ require File.dirname(__FILE__) + '/../../spec_helper' + require 'puppet/configurer/downloader' + + describe Puppet::Configurer::Downloader do ++ require 'puppet_spec/files' ++ include PuppetSpec::Files + it "should require a name" do + lambda { Puppet::Configurer::Downloader.new }.should raise_error(ArgumentError) + end +@@ -96,25 +98,35 @@ describe Puppet::Configurer::Downloader do + + describe "when creating the catalog to do the downloading" do + before do +- @dler = Puppet::Configurer::Downloader.new("foo", "path", "source") ++ @dler = Puppet::Configurer::Downloader.new("foo", "/download/path", "source") + end + + it "should create a catalog and add the file to it" do +- file = mock 'file' +- catalog = mock 'catalog' +- +- @dler.expects(:file).returns file +- +- Puppet::Resource::Catalog.expects(:new).returns catalog +- catalog.expects(:add_resource).with(file) ++ catalog = @dler.catalog ++ catalog.resources.size.should == 1 ++ catalog.resources.first.class.should == Puppet::Type::File ++ catalog.resources.first.name.should == "/download/path" ++ end + +- @dler.catalog.should equal(catalog) ++ it "should specify that it is not managing a host catalog" do ++ @dler.catalog.host_config.should == false + end ++ + end + + describe "when downloading" do + before do +- @dler = Puppet::Configurer::Downloader.new("foo", "path", "source") ++ @dl_name = tmpfile("downloadpath") ++ source_name = tmpfile("source") ++ File.open(source_name, 'w') {|f| f.write('hola mundo') } ++ @dler = Puppet::Configurer::Downloader.new("foo", @dl_name, source_name) ++ end ++ ++ it "should not skip downloaded resources when filtering on tags" do ++ Puppet[:tags] = 'maytag' ++ @dler.evaluate ++ ++ File.exists?(@dl_name).should be_true + end + + it "should log that it is downloading" do +-- +1.7.4.1 + diff --git a/0001-5428-More-fully-stub-Puppet-Resource-Reference-for-u.patch b/0001-5428-More-fully-stub-Puppet-Resource-Reference-for-u.patch new file mode 100644 index 0000000..55566ec --- /dev/null +++ b/0001-5428-More-fully-stub-Puppet-Resource-Reference-for-u.patch @@ -0,0 +1,182 @@ +From ff9e2425a58bb2b1ab836e440c3344b4012623c5 Mon Sep 17 00:00:00 2001 +From: Jacob Helwig <jacob@puppetlabs.com> +Date: Fri, 25 Feb 2011 17:03:56 -0800 +Subject: [PATCH/puppet] (#5428) More fully "stub" Puppet::Resource::Reference for use with storedconfigs + +The Puppet::Resource::Reference class wasn't stubbing enough of the 0.25.x +behavior to satisfy the needs of storedconfigs. Since P::R::Reference, +and Puppet::Resource were merged as part of 2.6.x, we can pretend that +P::Resource is P::R::Reference for the purposes of loading data from +storedconfigs. This should still satisfy the over-the-wire serialization +needs of 0.25.x. + +This also changes internal references to @parameters in +Puppet::Resource(::Reference) to go through a parameters method. This +allows us to "initialize" this instance variable lazily, since loading via +YAML bypasses the normal initialize method. + +Paired-with: Daniel Pittman <daniel@puppetlabs.com> +Reviewed-by: Markus Roberts <markus@puppetlabs.com> +--- + lib/puppet/resource.rb | 35 +++++++++++++++++++---------------- + spec/unit/resource_spec.rb | 26 ++++++++++++++++++++++++-- + 2 files changed, 43 insertions(+), 18 deletions(-) + +diff --git a/lib/puppet/resource.rb b/lib/puppet/resource.rb +index e832804..e47fc7e 100644 +--- a/lib/puppet/resource.rb ++++ b/lib/puppet/resource.rb +@@ -5,6 +5,11 @@ require 'puppet/util/pson' + # The simplest resource class. Eventually it will function as the + # base class for all resource-like behaviour. + class Puppet::Resource ++ # This stub class is only needed for serialization compatibility with 0.25.x. ++ # Specifically, it exists to provide a compatibility API when using YAML ++ # serialized objects loaded from StoreConfigs. ++ Reference = Puppet::Resource ++ + include Puppet::Util::Tagging + + require 'puppet/resource/type_collection_helper' +@@ -104,7 +109,7 @@ class Puppet::Resource + # be overridden at some point, but this works for now. + %w{has_key? keys length delete empty? <<}.each do |method| + define_method(method) do |*args| +- @parameters.send(method, *args) ++ parameters.send(method, *args) + end + end + +@@ -112,13 +117,13 @@ class Puppet::Resource + # to lower-case symbols. + def []=(param, value) + validate_parameter(param) if validate_parameters +- @parameters[parameter_name(param)] = value ++ parameters[parameter_name(param)] = value + end + + # Return a given parameter's value. Converts all passed names + # to lower-case symbols. + def [](param) +- @parameters[parameter_name(param)] ++ parameters[parameter_name(param)] + end + + def ==(other) +@@ -140,11 +145,11 @@ class Puppet::Resource + + # Iterate over each param/value pair, as required for Enumerable. + def each +- @parameters.each { |p,v| yield p, v } ++ parameters.each { |p,v| yield p, v } + end + + def include?(parameter) +- super || @parameters.keys.include?( parameter_name(parameter) ) ++ super || parameters.keys.include?( parameter_name(parameter) ) + end + + # These two methods are extracted into a Helper +@@ -170,14 +175,6 @@ class Puppet::Resource + end + end + +- # This stub class is only needed for serialization compatibility with 0.25.x +- class Reference +- attr_accessor :type,:title +- def initialize(type,title) +- @type,@title = type,title +- end +- end +- + # Create our resource. + def initialize(type, title = nil, attributes = {}) + @parameters = {} +@@ -204,7 +201,7 @@ class Puppet::Resource + tag(self.type) + tag(self.title) if valid_tag?(self.title) + +- @reference = Reference.new(@type,@title) # for serialization compatibility with 0.25.x ++ @reference = self # for serialization compatibility with 0.25.x + if strict? and ! resource_type + if @type == 'Class' + raise ArgumentError, "Could not find declared class #{title}" +@@ -234,7 +231,7 @@ class Puppet::Resource + + # Produce a simple hash of our parameters. + def to_hash +- parse_title.merge @parameters ++ parse_title.merge parameters + end + + def to_s +@@ -256,7 +253,7 @@ class Puppet::Resource + # Convert our resource to Puppet code. + def to_manifest + "%s { '%s':\n%s\n}" % [self.type.to_s.downcase, self.title, +- @parameters.collect { |p, v| ++ parameters.collect { |p, v| + if v.is_a? Array + " #{p} => [\'#{v.join("','")}\']" + else +@@ -422,4 +419,10 @@ class Puppet::Resource + return { :name => title.to_s } + end + end ++ ++ def parameters ++ # @parameters could have been loaded from YAML, causing it to be nil (by ++ # bypassing initialize). ++ @parameters ||= {} ++ end + end +diff --git a/spec/unit/resource_spec.rb b/spec/unit/resource_spec.rb +index ff31b24..4c1dc49 100755 +--- a/spec/unit/resource_spec.rb ++++ b/spec/unit/resource_spec.rb +@@ -99,11 +99,11 @@ describe Puppet::Resource do + end + + it 'should fail if strict is set and type does not exist' do +- lambda { Puppet::Resource.new('foo', 'title', {:strict=>true}) }.should raise_error(ArgumentError, 'Invalid resource type foo') ++ lambda { Puppet::Resource.new('foo', 'title', {:strict=>true}) }.should raise_error(ArgumentError, 'Invalid resource type foo') + end + + it 'should fail if strict is set and class does not exist' do +- lambda { Puppet::Resource.new('Class', 'foo', {:strict=>true}) }.should raise_error(ArgumentError, 'Could not find declared class foo') ++ lambda { Puppet::Resource.new('Class', 'foo', {:strict=>true}) }.should raise_error(ArgumentError, 'Could not find declared class foo') + end + + it "should fail if the title is a hash and the type is not a valid resource reference string" do +@@ -463,6 +463,28 @@ describe Puppet::Resource do + end + end + ++ describe "when loading 0.25.x storedconfigs YAML" do ++ before :each do ++ @old_storedconfig_yaml = %q{--- !ruby/object:Puppet::Resource::Reference ++builtin_type: ++title: /tmp/bar ++type: File ++} ++ end ++ ++ it "should deserialize a Puppet::Resource::Reference without exceptions" do ++ lambda { YAML.load(@old_storedconfig_yaml) }.should_not raise_error ++ end ++ ++ it "should deserialize as a Puppet::Resource::Reference as a Puppet::Resource" do ++ YAML.load(@old_storedconfig_yaml).class.should == Puppet::Resource ++ end ++ ++ it "should to_hash properly" do ++ YAML.load(@old_storedconfig_yaml).to_hash.should == { :path => "/tmp/bar" } ++ end ++ end ++ + describe "when converting to a RAL resource" do + it "should use the resource type's :new method to create the resource if the resource is of a builtin type" do + resource = Puppet::Resource.new("file", @basepath+"/my/file") +-- +1.7.4.1 + diff --git a/puppet-0.25.5.tar.gz.sign b/puppet-0.25.5.tar.gz.sign deleted file mode 100644 index 8cb537d..0000000 --- a/puppet-0.25.5.tar.gz.sign +++ /dev/null @@ -1,17 +0,0 @@ ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.4.10 (GNU/Linux) - -iQIcBAABAgAGBQJL8eKBAAoJEP+shliDR6J/INUP/1ge+BehyMcruFXKNyISr8Df -ZrWVYWs0keUqK2pxx34zeO/MUGbhGMwArxsH2eWcagXgujVZmW104B1EiFjw75Ok -3+pEjskUSWYoBJ4CpwZ0iJzr2D4L73A27xlzaDahGBd/sjLBwYjv69gs8EWdtBug -bvWIfJ2nbcMzipCY77JxECAcbqhVzEi/6hkrUs4bisXN4atiiPihEbBWdlCwS+Pw -nBTxZVqrTC/y7e+nxRtEvX0O3LZTAibfzE89SJX3YWVPSoUiR90jB/DWhPVaJEzr -0X1V3D79IE2gs2EO+S7JsoQfnWgVYGBYQmUGi9a3ZfDppo7aa4dDRTdQWHsF4bac -jHXkVFB1RV+nVF6O19YTbgrXcG5b/YcUEVqGXB+NvSDSrrF+aRoahFS4x+0HqK+h -DbnCv2ykPoCE/q7obbrYgx71pfskU4GEtL+rwtuynxMItq3E1lW0ZpQWt30+LwDW -tjMPrtsjuk/h48d79AbEWl3PPme5SZUfReQUcAs+yt0Y1yxjmvmAKzu0HQgJDtZL -io5JJ38zdMqtL7FLvnr6cK/rLDWz10yuvouwV922rghGh2qSFq0RZtt04RTjzcAJ -W/VVkUeL0BCccTzGX67DgkvRi7DEIGtZuw73M8kCkF/+TqlanHN8vSwRAKCmp3GU -UqZuvCGmazIIj4JH38/t -=1DPy ------END PGP SIGNATURE----- diff --git a/puppet-2.6.6.tar.gz.sign b/puppet-2.6.6.tar.gz.sign new file mode 100644 index 0000000..9ff429a --- /dev/null +++ b/puppet-2.6.6.tar.gz.sign @@ -0,0 +1,17 @@ +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.10 (GNU/Linux) + +iQIcBAABAgAGBQJNeAIeAAoJEBBUt6JL1uwwLqMP/A7L+ikXqLTc3X4gaPuiJcuI +dJW9fmzbOaeU1Bit4CaoA8e3gS2u+GybaxpW8eYhwAVGwws6NeKfoLXk7xXAl0X7 +pke5LMWl87vGw7orzeA/ck5QO4Gxel+OsDCXO18kRpnPswX/4FnaH8sF8u+y5kUU +2NuDabKPkMiDLjyC5TdXFP397hj0bRLmJjd2WtYo41nbjBJR6l3JOXWo5LlxGx6+ +8fzkqDXiNe/vERXm9As42SCehZ0QybRGEW8SgaXjLt4eXO4YJSpRhShRHP2f9d5C +3pUUnUHVuoQUWuNNA0W7wzS8CSKkmDVHyW5hWsMiyyE0u5THvOHBV8UvQ10QAF90 +mvcxiqwJYlxvPhuLGyEqGF+XpMqu4cS+f7ikNWtbacOdTY+uFLg5qSk25RwFGld7 +ASvlMP+H/Dp8uaxorCZt3dCTETmGbFWFiBgRrHRef6GR2H6gKqzDaRPoW30MNrVM +RAmb7xHHYeBoDf4msi5TJE546S3xfUwB/XjCNrQ8myuzg6engCgEmKB122BLq/DN +MmTZQx8DViYH+oPNQnOBkuFr3FeGNii+sZzC5VHyir3/8ksSQ4dSnKWbS8p8mGnP +5yR/WrUguN1HCdimKANWyGGfiKmNgADrDlOT3iUhjZs09ZR3IR2mTWVCLFcyu/Ft +ukGK0gYzxjK/2FF6uHoR +=/iZd +-----END PGP SIGNATURE----- diff --git a/puppet.spec b/puppet.spec index 5943e70..b00f5a5 100644 --- a/puppet.spec +++ b/puppet.spec @@ -5,13 +5,19 @@ %global confdir conf/redhat Name: puppet -Version: 0.25.5 +Version: 2.6.6 Release: 1%{?dist} Summary: A network tool for managing many disparate systems -License: GPLv2+ +License: GPLv2 URL: http://puppetlabs.com Source0: http://puppetlabs.com/downloads/%{name}/%{name}-%{version}.tar.gz Source1: http://puppetlabs.com/downloads/%{name}/%{name}-%{version}.tar.gz.sign +# http://projects.puppetlabs.com/issues/5428 +Patch0: 0001-5428-More-fully-stub-Puppet-Resource-Reference-for-u.patch +# http://projects.puppetlabs.com/issues/4922 +Patch1: 0001-4922-Don-t-truncate-remotely-sourced-files-on-404.patch +# http://projects.puppetlabs.com/issues/5073 +Patch2: 0001-5073-Download-plugins-even-if-you-re-filtering-on-ta.patch Group: System Environment/Base @@ -27,11 +33,11 @@ Requires: ruby-shadow %endif # Pull in ruby selinux bindings where available -%if 0%{?fedora} >= 12 || 0%{?rhel} >= 6 -%{!?_without_selinux:Requires: ruby(selinux)} +%if 0%{?fedora} || 0%{?rhel} >= 6 +%{!?_without_selinux:Requires: ruby(selinux), libselinux-utils} %else -%if 0%{?fedora} || 0%{?rhel} >= 5 -%{!?_without_selinux:Requires: libselinux-ruby} +%if 0%{?rhel} && 0%{?rhel} == 5 +%{!?_without_selinux:Requires: libselinux-ruby, libselinux-utils} %endif %endif @@ -66,7 +72,11 @@ The server can also function as a certificate authority and file server. %prep %setup -q -patch -p1 < conf/redhat/rundir-perms.patch +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +patch -s -p1 < conf/redhat/rundir-perms.patch + %build # Fix some rpmlint complaints @@ -91,6 +101,7 @@ rm -rf %{buildroot} ruby install.rb --destdir=%{buildroot} --quick --no-rdoc install -d -m0755 %{buildroot}%{_sysconfdir}/puppet/manifests +install -d -m0755 %{buildroot}%{_datadir}/%{name}/modules install -d -m0755 %{buildroot}%{_localstatedir}/lib/puppet install -d -m0755 %{buildroot}%{_localstatedir}/run/puppet install -d -m0750 %{buildroot}%{_localstatedir}/log/puppet @@ -100,7 +111,6 @@ install -Dp -m0644 %{confdir}/server.sysconfig %{buildroot}%{_sysconfdir}/syscon install -Dp -m0755 %{confdir}/server.init %{buildroot}%{_initrddir}/puppetmaster install -Dp -m0644 %{confdir}/fileserver.conf %{buildroot}%{_sysconfdir}/puppet/fileserver.conf install -Dp -m0644 %{confdir}/puppet.conf %{buildroot}%{_sysconfdir}/puppet/puppet.conf -install -Dp -m0644 conf/auth.conf %{buildroot}%{_sysconfdir}/puppet/auth.conf install -Dp -m0644 %{confdir}/logrotate %{buildroot}%{_sysconfdir}/logrotate.d/puppet # We need something for these ghosted files, otherwise rpmbuild @@ -126,6 +136,13 @@ vimdir=%{buildroot}%{_datadir}/vim/vimfiles install -Dp -m0644 ext/vim/ftdetect/puppet.vim $vimdir/ftdetect/puppet.vim install -Dp -m0644 ext/vim/syntax/puppet.vim $vimdir/syntax/puppet.vim +%if 0%{?fedora} >= 15 +# Setup tmpfiles.d config +mkdir mkdir -p %{buildroot}%{_sysconfdir}/tmpfiles.d +echo "D /var/run/%{name} 0755 %{name} %{name} -" > \ + %{buildroot}%{_sysconfdir}/tmpfiles.d/%{name}.conf +%endif + %files %defattr(-, root, root, 0755) %doc CHANGELOG COPYING LICENSE README README.queueing examples @@ -139,6 +156,9 @@ install -Dp -m0644 ext/vim/syntax/puppet.vim $vimdir/syntax/puppet.vim %{ruby_sitelibdir}/* %{_initrddir}/puppet %dir %{_sysconfdir}/puppet +%if 0%{?fedora} >= 15 +%config(noreplace) %{_sysconfdir}/tmpfiles.d/%{name}.conf +%endif %config(noreplace) %{_sysconfdir}/sysconfig/puppet %config(noreplace) %{_sysconfdir}/puppet/puppet.conf %config(noreplace) %{_sysconfdir}/puppet/auth.conf @@ -183,27 +203,48 @@ install -Dp -m0644 ext/vim/syntax/puppet.vim $vimdir/syntax/puppet.vim getent group puppet &>/dev/null || groupadd -r puppet -g 52 &>/dev/null getent passwd puppet &>/dev/null || \ useradd -r -u 52 -g puppet -d %{_localstatedir}/lib/puppet -s /sbin/nologin \ - -c "Puppet" puppet &>/dev/null || : + -c "Puppet" puppet &>/dev/null # ensure that old setups have the right puppet home dir if [ $1 -gt 1 ] ; then - usermod -d %{_localstatedir}/lib/puppet puppet &>/dev/null || : + usermod -d %{_localstatedir}/lib/puppet puppet &>/dev/null fi +exit 0 %post /sbin/chkconfig --add puppet || : +if [ "$1" -ge 1 ]; then + # The pidfile changed from 0.25.x to 2.6.x, handle upgrades without leaving + # the old process running. + oldpid="%{_localstatedir}/run/puppet/puppetd.pid" + newpid="%{_localstatedir}/run/puppet/agent.pid" + if [ -s "$oldpid" -a ! -s "$newpid" ]; then + (kill $(< "$oldpid") && rm -f "$oldpid" && \ + /sbin/service puppet start) >/dev/null 2>&1 || : + fi +fi %post server /sbin/chkconfig --add puppetmaster || : +if [ "$1" -ge 1 ]; then + # The pidfile changed from 0.25.x to 2.6.x, handle upgrades without leaving + # the old process running. + oldpid="%{_localstatedir}/run/puppet/puppetmasterd.pid" + newpid="%{_localstatedir}/run/puppet/master.pid" + if [ -s "$oldpid" -a ! -s "$newpid" ]; then + (kill $(< "$oldpid") && rm -f "$oldpid" && \ + /sbin/service puppetmaster start) >/dev/null 2>&1 || : + fi +fi %preun if [ "$1" = 0 ] ; then - /sbin/service puppet stop > /dev/null 2>&1 + /sbin/service puppet stop >/dev/null 2>&1 /sbin/chkconfig --del puppet || : fi %preun server if [ "$1" = 0 ] ; then - /sbin/service puppetmaster stop > /dev/null 2>&1 + /sbin/service puppetmaster stop >/dev/null 2>&1 /sbin/chkconfig --del puppetmaster || : fi @@ -214,13 +255,26 @@ fi %postun server if [ "$1" -ge 1 ]; then - /sbin/service puppetmaster condrestart > /dev/null 2>&1 || : + /sbin/service puppetmaster condrestart >/dev/null 2>&1 || : fi %clean rm -rf %{buildroot} %changelog +* Wed Mar 16 2011 Todd Zullinger <tmz@pobox.com> - 2.6.6-1 +- Update to 2.6.6 +- Ensure %%pre exits cleanly +- Fix License tag, puppet is now GPLv2 only +- Create and own /usr/share/puppet/modules (#615432) +- Properly restart puppet agent/master daemons on upgrades from 0.25.x +- Require libselinux-utils when selinux support is enabled +- Support tmpfiles.d for Fedora >= 15 (#656677) +- Apply a few upstream fixes for 0.25.5 regressions + +* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.25.5-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + * Mon May 17 2010 Todd Zullinger <tmz@pobox.com> - 0.25.5-1 - Update to 0.25.5 - Adjust selinux conditional for EL-6 @@ -1 +1 @@ -2988385801c967f7262cdf08640c9e07 puppet-0.25.5.tar.gz +58315e94ff00aedc4a19177877c3e865 puppet-2.6.6.tar.gz |