Issue #11320 has been updated by Ramin K.

The comment by James got me thinking so I did some testing. I *think* 
Puppet.settings[:node_name_value] should always exist and be correct, but I 
couldn't say for certain. Adding the additional fact didn't seem to interfere 
with existing facts in my limited testing and it was set correctly when 
defaulting to certname or fdqn. I think this the right method/place to handle 
it rather than in facter as it's like the rest of the internal facts in that it 
comes from puppet.conf. 

diff --git a/lib/puppet/node/facts.rb b/lib/puppet/node/facts.rb
index 8d0a034..a8441b8 100755
--- a/lib/puppet/node/facts.rb
+++ b/lib/puppet/node/facts.rb
@@ -27,6 +27,7 @@ class Puppet::Node::Facts
 
   def add_local_facts
     values["clientcert"] = Puppet.settings[:certname]
+    values["clientnode"] = Puppet.settings[:node_name_value]
     values["clientversion"] = Puppet.version.to_s
     values["environment"] ||= Puppet.settings[:environment]
   end
----------------------------------------
Feature #11320: node_name_value unavailible as a fact
https://projects.puppetlabs.com/issues/11320

Author: Ramin K
Status: Needs Decision
Priority: Normal
Assignee: Nigel Kersten
Category: 
Target version: 
Keywords: 
Branch: 
Affected Facter version: 


I'm not sure this is a bug so I'm calling it a feature until someone says 
otherwise. What I'm trying to do is divorce certname from fqdn and the name of 
the node from either of those. Comments in Issue #2128 could be interpreted to 
say that this is an acceptable and valid use case.  

Client is 2.7.6 with Facter 1.6.2. The master is 2.7.6. I have this set in my 
puppet.conf on the client. No changes to the standard config on the master for 
node names.

<pre>[agent]
certname = 007f0101
node_name_value = precise01.stage.aws</pre>

The above works and matches my regex for Ubuntu Precise testing. However I can 
not find any way to use the value of node_name_value as a fact.  

I could write a custom fact, but it seems like I should be able to access 
node_name in some way for manifests outside of it's mapping to certname, 
clientcert, hostname, or fqdn. Also I'm not sure that solves the problem since 
I'd end up setting node_name_fact rather than using node_name_value.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to