summaryrefslogtreecommitdiffstats
path: root/spec/integration
diff options
context:
space:
mode:
authorNick Lewis <nick@puppetlabs.com>2011-06-02 16:24:16 -0700
committerNick Lewis <nick@puppetlabs.com>2011-06-06 15:49:38 -0700
commit1c70f0ce54022b55119b9e2d6d60cd1ae9bc019e (patch)
tree35a7c2372773859c688cc4778a7c5507221553fa /spec/integration
parentc629958fb45f9ae3581f01835bf89654dd7967b7 (diff)
downloadpuppet-1c70f0ce54022b55119b9e2d6d60cd1ae9bc019e.tar.gz
puppet-1c70f0ce54022b55119b9e2d6d60cd1ae9bc019e.tar.xz
puppet-1c70f0ce54022b55119b9e2d6d60cd1ae9bc019e.zip
(#2128) Add support for setting node name based on a fact
This adds the node_name_fact setting, which specifies a fact to use to determine the node name. This allows dynamically determining the node name without having to modify puppet.conf or command line options. Using this setting requires modifying auth.conf to allow nodes to request catalogs not matching their certnames. For example, this would allow any authenticated node to retrieve any catalog: # $confdir/auth.conf path ~ /catalog/.+ allow * The node_name_fact and node_name_value options are mutually exclusive, because it is ambiguous which setting should take precedence. Paired-With: Jacob Helwig <jacob@puppetlabs.com>
Diffstat (limited to 'spec/integration')
-rwxr-xr-xspec/integration/defaults_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/integration/defaults_spec.rb b/spec/integration/defaults_spec.rb
index 572d98cde..3178fca11 100755
--- a/spec/integration/defaults_spec.rb
+++ b/spec/integration/defaults_spec.rb
@@ -30,6 +30,21 @@ describe "Puppet defaults" do
end
end
+ describe "when setting the :node_name_fact" do
+ it "should fail when also setting :node_name_value" do
+ lambda do
+ Puppet.settings[:node_name_value] = "some value"
+ Puppet.settings[:node_name_fact] = "some_fact"
+ end.should raise_error("Cannot specify both the node_name_value and node_name_fact settings")
+ end
+
+ it "should not fail when using the default for :node_name_value" do
+ lambda do
+ Puppet.settings[:node_name_fact] = "some_fact"
+ end.should_not raise_error
+ end
+ end
+
describe "when configuring the :crl" do
it "should warn if :cacrl is set to false" do
Puppet.expects(:warning)