Re: [Puppet Users] access exported resources in template

2012-11-21 Thread Bart Swedrowski
On Friday, September 7, 2012 2:01:13 PM UTC+1, ctrlc-root wrote: Well, 3 years old or not, this is still in the first page of google results haha. I'm running puppet version 2.7.9 and the result of that template is a blank comment line for every instance of the Firewall::Rule type. If I

Re: [Puppet Users] access exported resources in template

2012-09-09 Thread Luke Kanies
I don't quite know the answer, and I agree, a running shell would be useful. I'd be looking in Parser::Scope and the TemplateWrapper class, wherever it is. Those should generally cover it, with maybe Parser::Resource. You should try deeper inspection of the resources. I think

Re: [Puppet Users] access exported resources in template

2012-09-07 Thread ctrlc-root
Well, 3 years old or not, this is still in the first page of google results haha. I'm running puppet version 2.7.9 and the result of that template is a blank comment line for every instance of the Firewall::Rule type. If I replace 'resource[:comment]' with 'resource.type' then I can confirm

Re: [Puppet Users] access exported resources in template

2012-09-06 Thread ctrlc-root
The resource[:property] method doesn't seem to work. I'm pretty new with puppet and only just learned ruby, so I was hoping someone could perhaps just point me in the right direction. Here's what I've got so far: % scope.compiler.catalog.vertices.each do |resource| -% % if resource.type ==

Re: [Puppet Users] access exported resources in template

2012-09-06 Thread Luke Kanies
Wow, talk about a blast from the past. I don't get a lot of replies to 3 year old email. :) What happens when you do this? It looks like it should basically work, although I'd use 'resources' instead of 'vertices', I think. What version is this? On Sep 6, 2012, at 10:14 AM, ctrlc-root

[Puppet Users] access exported resources in template

2009-10-19 Thread Bernhard Bock
Hi, I'm trying to develop a class that autogenerates a config file based on an .erb template. It shall populate the config file with data exported from various hosts. Some pseudocode to clarify my issue: node n1 { @@mytype { name: property = foo } } template.erb: %