Dan Bode
2009-Jul-08 09:31 UTC
[Puppet Users] parsing config from within external node scripts
Hi I would like to use
Puppet.parse_confg from within external nodes (or more specifically, trying
to parse the puppet config)
if I run the following from irb, everything is ok:
irb(main):005:0> require "puppet"
=> []
irb(main):006:0> Puppet.parse_config
=> [:main, :name, :memory, :cli]
irb(main):008:0> Puppet[:yamldir]
*=> "/var/lib/puppet/yaml"*
but from within an external node script, I get a different value:
..happy ruby code here
yaml_file =* Puppet[:yamldir]* << "/facts/" << hostname
<< ".yaml"
props = YAML::load_file( yaml_file )
...more happy code
returns: (yes I am running this as root!)
No such file or directory - /root/.puppet/var/yaml/facts/SERVER.yaml
(Errno::ENOENT)
why does this param return* /root/.puppet/var/yaml* when called from within
puppet, where does it get this from?
any thoughts, maybe I am just using the wrong call, should I not be using
this?
Dan Bode
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---