Hi,
I use an augeas resource that manages the FW_CONFIGURATIONS_$zone entry in
etc/sysconfig/SuSEfirewall2.
augeas {"fwservice_${svc}-$zone":
context => "/files/etc/sysconfig/SuSEfirewall2",
onlyif => "match FW_CONFIGURATIONS_$zone/value[.='$svc'] size == 0",
changes => [
"set FW_CONFIGURATIONS_$zone/value[.='$svc'] $svc",
],
load_path => "$augeas::params::lense_path",
require => Augeas::Lense['shellvars_list.aug'],
notify => Service["firewall"],
}
Each service adds a config file to /etc/sysconfig/SuSEfirewall2.d/services/
For example, in svn (the svn pkg supplies it own services file) …
firewall::service{"svnserve":
allow => true,
require => Package["${svn::params::svn_apache_pkg}"],
}
Cheers
On 12/06/2012, at 5:49 AM, 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?
>
> Thanks,
> Mike
>
> --
> 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.
>
--
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.