Thanks for the response, Henrik.
I’ve tried what you suggested already:
node=Puppet::Node.new('localhost')
compiler=Puppet::Parser::Compiler.new(node)
scope=Puppet::Parser::Scope.new(compiler)
..but the result is:
/usr/lib/ruby/vendor_ruby/puppet/context.rb:43:in `lookup': no 'environments' in {:root_environment=>#<Puppet::Node::Environment:0x7f31f0383230 @modulepath=[], @name=:"*root*", @manifest="path_to_my_script_dir">, :current_environment=>#<Puppet::Node::Environment:0x7f31f0383230 @modulepath=[], @name=:"*root*", @manifest="path_to_my_script_dir">} at top of [] (Puppet::Context::UndefinedBindingError)
..where path_to_my_script_dir
is the absolute path of the directory containing my ruby script.
Is there a way for me to set up the correct context and/or environments mentioned in this error message?
Cheers,
Dave