eduardo
2012-Jul-22 02:36 UTC
[Puppet Users] How to get puppetmaster''s base directory into a variable ?
Dears all, I need set variable $puppet_base_dir on my prerequisites class with confdir parameter value of puppetmaster. I need the variable to be used as base directory path of a file named myfile, which it''s read it in custom function. I''m trying to avoid absolute path ''/etc/pupet/ files/myfile'' , I want to get it from puppetmaster configuration so i can do something like ${puppet_base_dir}/files/myfile . To do it, I create a custom function which have only one line of code : puppet_dir = %x{puppet master --configprint confdir}.chomp I''m thinking might be a dumb solution. Is there a simple way to do it ?. Thanks in advanced. eduardo. -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
James Glenn
2012-Jul-22 06:53 UTC
Re: [Puppet Users] How to get puppetmaster''s base directory into a variable ?
On Sat, Jul 21, 2012 at 9:36 PM, eduardo <erodri07@gmail.com> wrote:> Dears all, > > I need set variable $puppet_base_dir on my prerequisites class with > confdir parameter value of puppetmaster. I need the variable to be > used as base directory path of a file named myfile, which it''s read it > in custom function. I''m trying to avoid absolute path ''/etc/pupet/ > files/myfile'' , I want to get it from puppetmaster configuration so i > can do something like ${puppet_base_dir}/files/myfile . > > To do it, I create a custom function which have only one line of > code : > > puppet_dir = %x{puppet master --configprint confdir}.chomp > > I''m thinking might be a dumb solution. > > Is there a simple way to do it ?. > > Thanks in advanced. > eduardo. >$settings::confdir This will have the variable you are looking for. See http://docs.puppetlabs.com/guides/faq.html#are-there-variables-available-other-than-those-provided-by-facter and http://docs.puppetlabs.com/references/stable/configuration.html#confdir Thanks, James Glenn -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
eduardo
2012-Jul-22 12:46 UTC
Re: [Puppet Users] How to get puppetmaster''s base directory into a variable ?
James Glenn ha escrito:> On Sat, Jul 21, 2012 at 9:36 PM, eduardo <erodri07@gmail.com> wrote: > > > Dears all, > > > > I need set variable $puppet_base_dir on my prerequisites class with > > confdir parameter value of puppetmaster. I need the variable to be > > used as base directory path of a file named myfile, which it''s read it > > in custom function. I''m trying to avoid absolute path ''/etc/pupet/ > > files/myfile'' , I want to get it from puppetmaster configuration so i > > can do something like ${puppet_base_dir}/files/myfile . > > > > To do it, I create a custom function which have only one line of > > code : > > > > puppet_dir = %x{puppet master --configprint confdir}.chomp > > > > I''m thinking might be a dumb solution. > > > > Is there a simple way to do it ?. > > > > Thanks in advanced. > > eduardo. > > > > $settings::confdir > This will have the variable you are looking for. > > See > http://docs.puppetlabs.com/guides/faq.html#are-there-variables-available-other-than-those-provided-by-facter > and http://docs.puppetlabs.com/references/stable/configuration.html#confdir > > Thanks, > James GlennThanks you very much James. It''s exactly. Regards, eduardo -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.