Using firewall module, how do I clear iptables before rules are applied?

224 views
Skip to first unread message

beamin melbin

unread,
Nov 28, 2011, 12:02:40 AM11/28/11
to Puppet Users
I am currently using Puppet's firewall module:

http://forge.puppetlabs.com/puppetlabs/firewall

I am trying to have Puppet flush iptables before it applies firewall
rules. I tried the following:

exec { 'clear-firewall':
command => '/sbin/iptables -F',
refreshonly => true,
}

Firewall {
subscribe => Exec['clear-firewall'],
notify => Exec['persist-firewall'],
}

So far, it has not worked. Can anyone suggest or know of another
method I should try?

Steve Traylen

unread,
Nov 28, 2011, 12:18:29 PM11/28/11
to puppet...@googlegroups.com
On Mon, Nov 28, 2011 at 6:02 AM, beamin melbin <bel...@gmail.com> wrote:
> I am currently using Puppet's firewall module:
>
> http://forge.puppetlabs.com/puppetlabs/firewall
>
> I am trying to have Puppet flush iptables before it applies firewall
> rules. I tried the following:

Are you trying to remove all rules that are not configured with puppet?
In which case the following will do but I'm not positive that is you want?

resources { 'firewall':
purge => true
}

--
Steve Traylen

beamin melbin

unread,
Nov 28, 2011, 12:44:39 PM11/28/11
to Puppet Users
That is exactly what I wanted. Thank you Steve!

On Nov 28, 12:18 pm, Steve Traylen <steve.tray...@cern.ch> wrote:

Reply all
Reply to author
Forward
0 new messages