On Jun 11, 2:49 pm, Michael Smith <[email protected]> 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?


What Felix said, especially about hiera.  Moreover, if you use hiera's
Puppet backend (whose purpose is to load data from Puppet variables),
you might be able to make it work very similarly to the way you
described.  On the other hand, I think Felix was going more for
constructing your port list via the structure of the external data,
and that might be the easiest way.


John

-- 
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