The Puppet Labs Issue Tracker has Moved:

This issue tracker is now in read-only archive mode and automatic ticket export has been disabled. Redmine users will need to create a new JIRA account to file tickets using See the following page for information on filing tickets with JIRA:

Feature #10166

Clean rules not defined by module except on CHAIN

Added by Pablo Iranzo Gómez over 4 years ago. Updated about 3 years ago.

Status:ClosedStart date:10/19/2011
Priority:NormalDue date:
Assignee:-% Done:


Category:firewallSpent time:-
Target version:-
Keywords: Branch:

We've Moved!

Ticket tracking is now hosted in JIRA:


Everything from INPUT or FORWARD is sent to RH-Firewall rule, when we input all the rules required by system services.

On INPUT we add extra temporary rules to apply that we don’t want to clean if they are defined (as the temporary process that included them would take care for removal).

We would like to aply the

 resources { 'firewall':
   purge => false,

But only on one CHAIN or to ALL BUT one Chain.


#1 Updated by Ken Barber over 4 years ago

  • Description updated (diff)
  • Status changed from Unreviewed to Accepted

#2 Updated by Steve Traylen almost 4 years ago

Here is the openstack nova use case for this, nova creates jumps in INPUT, OUTPUT, .. which puppet could replicate to stop them being trashed by a purge.

Chain INPUT (policy ACCEPT)
target prot opt source destination 
nova-compute-INPUT all –

Chain FORWARD (policy ACCEPT)
target prot opt source destination 
nova-filter-top all – 
nova-compute-FORWARD all –

Chain OUTPUT (policy ACCEPT)
target prot opt source destination 
nova-filter-top all – 
nova-compute-OUTPUT all –

and then nova manages things in these extra chains very dynamically, e.g as VMs are created and deleted. reference.

Request #12916 mentions ‘unmanaged_chains’ are you thinking this could be an attribute to the firewall chain.

I think this is conceptually very similar to the purge attribute on the file type for a directory? so how about

firewallchain {'INPUT_LOCAL:filter:IPv4':
     ensure => present,
     purge => true    # or false for puppet to leave the chain untouched.

If this firewallchain purge was default false then the global

resources { 'firewall':
   purge => false,

could still delete everything but now the individual chains could be tuned, the following would probably have to be possible.

firewallchain {'INPUT:filter:IPv4':
     ensure => present,
     purge => true    # or false for puppet to leave the chain untouched.

so the built chains themselves could be tuned for purge or not.

#3 Updated by Ken Barber almost 4 years ago

So I’ve done some testing, and I think this is entirely possible – but it introduces something new and scary that no providers I know of do yet, and thats catalog lookup.

I managed to get the values of properties from the firewall chain, inside the Puppet::Provider::Firewall#delete method:

def delete
  catalog = self.resource.catalog
  chain_resource = catalog.resource("Firewallchain[mychain]")
  chain_properties =
  chain_properties.each do |p|
    notice("  #{} #{p.value}")

  ... and the rest ...

So as you can see, this is entirely possible to do. In my mind, I would imagine a lookup to the firewallchain resource that the rule applies to, then skipping the delete if that firewallchain resource has purged => false or some such.

So technically possible yes – and a very interesting concept indeed :–).

#4 Updated by Anastasis Andronidis over 3 years ago

I made an effort to add this feature.

#5 Updated by Ken Barber about 3 years ago

  • Status changed from Accepted to Closed

Hiya … I’ve fall behind a bit on all this work, also the bug tracker is moving to here: I’ve managed to move what I still think is relevant and merge up items that are related. Consider this a slight declaration of ‘ticket debt’. If you think you’re issue isn’t represented in the new tracker feel free to open a new one.

Apologies for any confusion :–).


#6 Updated by Ken Barber about 3 years ago

Sorry – the new URL is actually: … thanks @Wolfspyre.

Also available in: Atom PDF