Hi,

On 06/11/2012 09:49 PM, Michael Smith wrote:
> Hi,
> 
> I'm using Puppet to configure SuSEfirewall2. I have a class that lets me
> set a list of ports to open in a variable in
> /etc/sysconfig/SuSEfirewall2. It's just a wrapper around an Augeas
> resource.
> 
> How can I make it so multiple classes can contribute a list of ports to
> my firewall class? For example:
> 
> class class1 {
>   firewall::tcp { '123': }
> }
> 
> class class2 {
>   firewall::tcp { '456': }
> }
> 
> # this would result in ports 123 and 456 being open
> # (FW_SERVICES_EXT_TCP="123 456" in the firewall config file)
> include class1
> include class2
> 
> I think I need a way to append 123 and 456 to some kind of global
> variable so my firewall class can pass the variable to an Augeas
> resource. Is something like this possible?

Yes, but I know of no way that doesn't include resorting to some pretty
evil hacks.

The modern approach would be to use hiera (or extlookup if you're more
oldfashioned) and devise a model that can derive the full list of ports
from the information you supply about the node in question.

HTH,
Felix

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to