Iterating over resources in puppet templates
- by daveg
So I've got a puppet manifest, with multiple resources
class foo {
Custom::Resource {'resource1':
attr1 => 'val1',
attr2 => 'val2',
}
Custom::Resource {'resource2':
attr1 => 'val3',
attr2 => 'val4',
}
Custom::Resource {'resource3':
attr1 => 'val5',
attr2 => 'val6',
}
}
If I wanted to loop over the Custom::Resource resource names in an .erb template that are defined in class foo, how do I access them? So if I wanted to write out a template that looked like this:
ThisLine = resource1
ThisLine = resource2
ThisLine = resource3