I'll have to check that out that does seem to look a little better
what I figured out before.

What I did was this, which is just a different way.

db_props =
Puppet::Module.modulepath(scope.lookupvar("environment")).to_s + '/
module_name/conf/db.yaml'



On Jul 26, 10:46 am, Nan Liu <n...@puppetlabs.com> wrote:
> On Mon, Jul 25, 2011 at 8:09 PM, Matt <mjbl...@gmail.com> wrote:
> > Is there a way to load a file from within the module in Ruby DSL?
>
> > The idea I have is to load a file similar to like how template works.
>
> > I'm trying to read in a database properties file and I would like to
> > keep within the module instead of hard coding paths.
>
> Not sure if there's a better way:
>
> mod = Puppet::Module.find('module_name')
> mod.path
>
> > mod = Puppet::Module.find('motd')
> > mod.path
>
> => "/etc/puppetlabs/puppet/modules/motd"
>
> Thanks,
>
> Nan

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to