|
template context question: msg#00222sysutils.puppet.user
I am trying to wrap my head around using templates and was wondering what the execution context was, puppetmaster or client? I thought it was client since it would have to also account for facter-based variables, but recent testing on something I thought was pretty neat turned out to cause puppetmaster to segfault in an apparent attempt to evaluate the template on the server side. The template section I was using was: %# This section generates a cfg_dir directive for each directory %# found within /etc/nagios/client (if any). <% require 'pathname' %> <% p = Pathname.new("/etc/nagios/client") %> <% if File.directory?(p) then %> # Include any per-client directories specified in the site definition. <% Dir.glob(File.join(p,"*")).each do |val| %> <% if File.directory?(p+val) then %> cfg_dir=<%= p+val %> <% end %> <% end %> <% end %> I am pretty much learning Ruby on the fly as I work through this, so be gentle with me :). The goal here is to make a nagios.cfg file be able to locally determine if there is a /etc/nagios/client directory and include each as a configuration directive. Regardless of whether this is the right way to handle the requirement, I'm more curious now whether using templates in this way is (a) possible and (b) sensical. I felt as I was doing it that I was violating the philosophy of puppet and I think I was punished for it :). Thanks, Mark |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: client update to 0.23.2: "Could not find value for": 00222, David Escala |
|---|---|
| Next by Date: | Re: template context question: 00222, Matthew Palmer |
| Previous by Thread: | Puppet port/install on FreeBSD & Open BSi: 00222, Deepak Naidu |
| Next by Thread: | Re: template context question: 00222, Matthew Palmer |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |