--
You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-dev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/54089B49.40304%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-dev+...@googlegroups.com.To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/CANs%2BFoWMs_%2B3_N3HECGeUsBxOO62VdrLrA6aAjd97fjn_Vx4yQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/CADxAQ5r7%3DdkD-Nb5HpEei15%3DG7H5xbxQwaDB3cGepBMwphm6UA%40mail.gmail.com.
Yes, I'm looking for the environment specific modulepath.Maybe this is a more complete example:example = Puppet::Module.find('example', Puppet[:environment].to_s)raise(LoadError, "Unable to find example module in modulepath #{Puppet[:modulepath]}") unless exampleYAML.load_file(File.join(example.path, 'data/foo.yaml'))
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/CACqVBqD5ES70JRujWqQM2SMsoWmam5X5_9Npgz8e%3DBbjWFZrhw%40mail.gmail.com.
On Thu, Sep 4, 2014 at 12:34 PM, Nan Liu <nan...@gmail.com> wrote:
Yes, I'm looking for the environment specific modulepath.Maybe this is a more complete example:example = Puppet::Module.find('example', Puppet[:environment].to_s)raise(LoadError, "Unable to find example module in modulepath #{Puppet[:modulepath]}") unless exampleYAML.load_file(File.join(example.path, 'data/foo.yaml'))Where will this code be executing? On the master, during a catalog compilation? If so, you probably want:environment = Puppet.lookup(:current_environment)environment.modulepath
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/CADxAQ5p7SuDZ2W3%3Daw4mWyMRyoE49aTesGN5BzDdty6azD5N4w%40mail.gmail.com.
On Thu, Sep 4, 2014 at 1:05 PM, Joshua Partlow <joshua....@puppetlabs.com> wrote:
On Thu, Sep 4, 2014 at 12:34 PM, Nan Liu <nan...@gmail.com> wrote:
Yes, I'm looking for the environment specific modulepath.Maybe this is a more complete example:example = Puppet::Module.find('example', Puppet[:environment].to_s)raise(LoadError, "Unable to find example module in modulepath #{Puppet[:modulepath]}") unless exampleYAML.load_file(File.join(example.path, 'data/foo.yaml'))Where will this code be executing? On the master, during a catalog compilation? If so, you probably want:
environment = Puppet.lookup(:current_environment)environment.modulepathand
mod = environment.module('example')to get the module from the environment.