From 266aafa6efa9dff5fb0b49ffdafc9372edcafdfe Mon Sep 17 00:00:00 2001 From: Till Maas Date: Sun, 2 Aug 2009 11:20:30 +0200 Subject: default server in remote filebuckets With the path parameter set to false, the server defaults to Puppet[:server]. This allows to use a remote filebucket without syncing the servername there with the one used on the config file. To use the default server, this manifest can be used: filebucket { main: path => false } A related bug report is: http://projects.reductivelabs.com/issues/2456 --- spec/unit/type/filebucket.rb | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 spec/unit/type/filebucket.rb (limited to 'spec/unit') diff --git a/spec/unit/type/filebucket.rb b/spec/unit/type/filebucket.rb new file mode 100644 index 000000000..9a635d517 --- /dev/null +++ b/spec/unit/type/filebucket.rb @@ -0,0 +1,30 @@ +#!/usr/bin/env ruby + +require File.dirname(__FILE__) + '/../../spec_helper' + +describe Puppet::Type.type(:filebucket) do + it "be local by default" do + bucket = Puppet::Type.type(:filebucket).new :name => "main" + + bucket.name.should == "main" + bucket.bucket.should be_instance_of(Puppet::Network::Client::Dipper) + bucket.bucket.local.should == true + end + + it "not be local if path is false" do + bucket = Puppet::Type.type(:filebucket).new :name => "main", :path => false + + bucket.name.should == "main" + bucket.bucket.should be_instance_of(Puppet::Network::Client::Dipper) + bucket.bucket.local.should_not == true + end + + it "not be local if a server is specified" do + bucket = Puppet::Type.type(:filebucket).new :name => "main", :server => "puppet" + + bucket.name.should == "main" + bucket.bucket.should be_instance_of(Puppet::Network::Client::Dipper) + bucket.bucket.local.should_not == true + end + +end -- cgit