Skip to content

Instantly share code, notes, and snippets.

@pmoranga
Created February 8, 2016 23:55
Show Gist options
  • Save pmoranga/9c4f194a1ac4102d4f94 to your computer and use it in GitHub Desktop.
Save pmoranga/9c4f194a1ac4102d4f94 to your computer and use it in GitHub Desktop.
Make puppetlabs-firewall works with docker smoothly
class my_fw::pre {
# Disable due to selective purges of firewallchain
# resources { "firewall":
# purge => true
# }
# Avoid removing Docker rules:
firewallchain { 'FORWARD:filter:IPv4':
purge => true,
ignore => [ 'docker' ],
}
firewallchain { 'DOCKER:filter:IPv4':
purge => false,
}
firewallchain { 'DOCKER:nat:IPv4':
purge => false,
}
firewallchain { 'POSTROUTING:nat:IPv4':
purge => true,
ignore => [ 'docker', '172.17' ],
}
firewallchain { 'PREROUTING:nat:IPv4':
purge => true,
ignore => [ 'DOCKER' ],
}
#ensure input rules are cleaned out
firewallchain { 'INPUT:filter:IPv4':
ensure => present,
purge => true,
}
# Block what ever.....
}
@pmoranga
Copy link
Author

pmoranga commented May 16, 2023

cool! thanks for sharing! I miss Puppet's power.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment