Adding to Paul's answer, if you want to set more than one port here, you'll
probably want to make a define for a port and loop on resources.
The define can then use augeas to set the port.
On Monday, May 28, 2012 5:47:52 PM UTC+2, Steve Foster wrote:
>
> Hi Folks,
>
> I'm trying to figure our why if I pass an array to a augeas resource type
> it ends up being concatenated eg for the following example I would expect
> 2 firewall rules, but instead I get one rule with the dport = 17001701
>
> class {'test':
> port => ['1700', '1701'],
> }
>
> class test ($port) {
>
> augeas{"$port":
> context => "/files/etc/sysconfig/iptables/table",
> changes => ['ins append before append[.="INPUT"][last()]',
> 'defnode INPUT append[.=""] INPUT',
> 'set $INPUT INPUT',
> 'set $INPUT/match[1] state',
> 'set $INPUT/state NEW',
> 'set $INPUT/match[2] tcp',
> 'set $INPUT/protocol tcp',
> "set \$INPUT/dport $port",
> 'set $INPUT/jump ACCEPT'],
> onlyif => "match append[*]/dport[.=\"$port\"] size == 0",
>
> }
> }
>
> Anyone got any suggestions?
>
> Cheers
>
> Steve
>
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/puppet-users/-/vJ1PQ9bhhsUJ.
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.