diff options
| author | Nick Lewis <nick@puppetlabs.com> | 2011-06-02 16:16:12 -0700 |
|---|---|---|
| committer | Nick Lewis <nick@puppetlabs.com> | 2011-06-06 15:48:58 -0700 |
| commit | cd4fe148aae923f1167a3db450b64ead87418018 (patch) | |
| tree | 84f24295a1767b6bad7daceae012147152186902 /spec/unit/configurer | |
| parent | a00fd25547db6dec8fcd57a004fbec58324ce3dc (diff) | |
| download | puppet-cd4fe148aae923f1167a3db450b64ead87418018.tar.gz puppet-cd4fe148aae923f1167a3db450b64ead87418018.tar.xz puppet-cd4fe148aae923f1167a3db450b64ead87418018.zip | |
(#2128) Add the ability to specify a node name
The setting node_name_value may now be used for 'puppet apply' or 'puppet
agent' to specify the name for the node. This will not affect the certificate
used by the node, and the node will still be authenticated based on its
certname. The default value for node_name_value is the certname.
This is useful for eg. EC2 nodes whose random hostnames cannot be easily used
to classify them.
Paired-With: Jacob Helwig
Diffstat (limited to 'spec/unit/configurer')
| -rwxr-xr-x | spec/unit/configurer/fact_handler_spec.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/unit/configurer/fact_handler_spec.rb b/spec/unit/configurer/fact_handler_spec.rb index 241da57d6..ddb541174 100755 --- a/spec/unit/configurer/fact_handler_spec.rb +++ b/spec/unit/configurer/fact_handler_spec.rb @@ -50,6 +50,17 @@ describe Puppet::Configurer::FactHandler do Puppet::Node::Facts.terminus_class = :memory end + it "should use the node name value to retrieve the facts" do + foo_facts = Puppet::Node::Facts.new('foo') + bar_facts = Puppet::Node::Facts.new('bar') + foo_facts.save + bar_facts.save + Puppet[:certname] = 'foo' + Puppet[:node_name_value] = 'bar' + + @facthandler.find_facts.should == bar_facts + end + it "should reload Facter before finding facts" do @facthandler.expects(:reload_facter) |
