How do I access the value of "puppetserver" from Ruby script?
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.