Browse Source

Allow setting iptables chain policy

tags/2016.12
Filip Pytloun 9 years ago
parent
commit
9dc2a1a4fa
2 changed files with 9 additions and 1 deletions
  1. +1
    -0
      README.rst
  2. +8
    -1
      iptables/service.sls

+ 1
- 0
README.rst View File

chain: chain:
INPUT: INPUT:
enabled: true enabled: true
policy: DROP
rule: rule:
httpd: httpd:
position: 1 position: 1

+ 8
- 1
iptables/service.sls View File

- pkg: iptables_packages - pkg: iptables_packages


{%- for chain_name, chain in service.get('chain', {}).iteritems() %} {%- for chain_name, chain in service.get('chain', {}).iteritems() %}

{%- if chain.policy is defined %}
iptables_{{ chain_name }}_policy:
iptables.set_policy:
- chain: {{ chain_name }}
- policy: {{ chain.policy }}
{%- endif %}

{%- for rule_name, rule in chain.get('rule', {}).iteritems() %} {%- for rule_name, rule in chain.get('rule', {}).iteritems() %}


iptables_{{ chain_name }}_{{ rule_name }}: iptables_{{ chain_name }}_{{ rule_name }}:

Loading…
Cancel
Save