Skip to content

Commit

Permalink
refactor(tables.sls): remove dictsort from tables.sls
Browse files Browse the repository at this point in the history
This removes the behavior of sorting rules before execution which is not needed
  • Loading branch information
Akrugerus authored Apr 19, 2021
1 parent a7790ed commit 05a274c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions iptables/tables.sls
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ chain_present_{{ t }}_{{ cn }}:
{%- for cn, cv in firewall.get(t).items() %}
{%- set pol = cv.policy | default('ACCEPT') %}
{%- set rules = cv.rules | default({}) %}
{%- for rn, rv in rules|dictsort %}
{%- for rn in rules %}
rule_{{ t }}_{{ cn }}_{{ rn }}:
{%- if rv['position'] is defined %}
{%- if rules[rn]['position'] is defined %}
iptables.insert:
{%- else %}
iptables.append:
{%- endif %}
- table: {{ t }}
- chain: {{ cn }}
{%- for k,v in rv.items() %}
{%- for k,v in rules[rn].items() %}
- {{ k }}: '{{ v }}'
{%- endfor %}
- save: true
Expand Down

0 comments on commit 05a274c

Please sign in to comment.