On Tue, Sep 6, 2011 at 7:24 AM, Matt <mjbl...@gmail.com> wrote: > I know I brought this up in a different post a while ago in as a > different question. > > Whats the best way to locate a configuration file from a ruby > manifest? I'm tring to load a yaml for database properties but so far > the only way to make it work is if I explicitly define a path either > manually or looking up a specific module path. The latter being an > issue if the module name is not known when it is installed.
Not sure if there's an exposed API that's more suitable. What are you using currently for find the file in a specific module? I'm not sure why the module name is unknown, unless you are planning to allow someone to change it during installation. Similar to puppet manifests you should be able to use the puppet variable $module_name if you are on 2.6+. Since the files directory is intended for file service, the best place for the config is probably the templates directory. The following should return the fully qualified filepath to the config file in the module templates dir: Puppet::Parser::Files.find_template_in_module("#{scope.lookup_var('module_name')}/config.yaml") 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.