You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
require'yaml'Puppet::Parser::Functions.newfunction(:extract,:type=>:rvalue)do |args|
raisePuppet::ParseError,"Expects 2 arguments, not #{args.size}"unlessargs.size == 2raisePuppet::ParseError,"First function must be an existing filename"unlessFile.exists?(args[0])filename=args[0]key=args[1]cnf=YAML::load_file(filename)cnf[key]ifcnfend
puppet apply -e "notice(extract("/etc/classes.yaml", 'classes'))"
notice: Scope(Class[main]): custom bar
notice: Finished catalog run in 0.03 seconds
puppet module install camptocamp-augeasfacter
puppet apply -e "notice(extract("/etc/classes.yaml", 'classes'))"
notice: Finished catalog run in 0.03 seconds
Standard puppet apply is not working.
But: site.pp will be parsed when using puppet apply with augeasfacter installed.
Puppet Version: PE 2.8.1 (Puppet 2.7.21) on CentOS 6.3
The text was updated successfully, but these errors were encountered:
From puppet developer training:
extract.rb:
puppet apply -e "notice(extract("/etc/classes.yaml", 'classes'))"
notice: Scope(Class[main]): custom bar
notice: Finished catalog run in 0.03 seconds
puppet module install camptocamp-augeasfacter
puppet apply -e "notice(extract("/etc/classes.yaml", 'classes'))"
notice: Finished catalog run in 0.03 seconds
Standard puppet apply is not working.
But: site.pp will be parsed when using puppet apply with augeasfacter installed.
Puppet Version: PE 2.8.1 (Puppet 2.7.21) on CentOS 6.3
The text was updated successfully, but these errors were encountered: