1234567891011121314151617181920212223242526272829303132333435363738 |
- #
- # nftables state
- #
- {% if not 'no-nftables' in salt['pillar.get']('nodes:' ~ grains['id'] ~ ':tags', []) %}
- nftables:
- pkg.installed:
- - name: nftables
- service.running:
- - enable: true
- - reload: true
- /etc/nftables.conf:
- file.managed:
- - source: salt://nftables/nftables.conf.tmpl
- - template: jinja
- - mode: 755
- - require:
- - pkg: nftables
- - watch_in:
- - service: nftables
- {% set no_purge_roles = ['docker', 'kvm'] %}
- {% set roles = salt['pillar.get']('nodes:' ~ grains['id'] ~ ':roles', [])%}
- {% set not_purge_iptables = salt['ffho.any_item_in_list'](no_purge_roles, roles) %}
- purge-iptables:
- pkg.purged:
- - pkgs:
- - iptables-persistent
- {%- if not not_purge_iptables %}
- - iptables
- {%- endif %}
- {% endif %}
|