Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am currently using Puppet's new firewall module. 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?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

So I imagine you are in one of two situations:

  1. You have existing rules you wish to flush because you want the puppet configuration to own your firewall rules
  2. You have existing rules that are not compatible with the firewall provider

If its 1 ... just try turning on purge somewhere in top scope:

resources { "firewall":
  purge => true,
}

If its 2 ... you will probably need to purge those rules or make them compatible before puppet runs. If you have a particular incompatibility let me know - we should probably get a bug raised on it.

share|improve this answer
    
Situation 1. And thank you! I will test it this evening. Did not see that in the documentation (puppet describe firewall). –  Belmin Fernandez Nov 28 '11 at 15:55
    
In my manifests, I have that in site.pp but Puppet is still not purging the firewall rules. –  Rob Jan 24 at 14:50
    
@Rob sounds like a bug. –  Ken Barber Jan 27 at 20:16
    
@KenBarber I think it is. github.com/puppetlabs/puppetlabs-firewall/issues/259 –  Rob Jan 30 at 15:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.