Quantcast
Channel: Ask Puppet: Puppet DevOps Q&A Community - RSS feed
Viewing all articles
Browse latest Browse all 6104

How do I access the value of "puppetserver" from Ruby script?

$
0
0
I need to set a custom fact, based on the IP of the Puppet Server that is visible from both the Puppet server and client. From within a manifest that is common to both sides I can use the value $puppetserver. However, I need to access this same variable from one of my Ruby scripts/functions. I understand that it is in base::params. I need to retrieve this IP address so I can pass it to another Ruby script/function that will set my custom fact. I've tried accessing the value using Facter.value(:puppetserver) and Facter.value('puppetserver'), but both methods appear to return nil, so I'm guessing I have a scope problem and I don't know enough about either Ruby or Puppet to figure out the right syntax. Thanks, Ron

Viewing all articles
Browse latest Browse all 6104

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>