33 lines
804 B
Plaintext
33 lines
804 B
Plaintext
---
|
|
{%- from "nftables/map.jinja" import nftables with context %}
|
|
nftables-config-dir:
|
|
file.directory:
|
|
- name: {{ nftables.config_dir }}
|
|
|
|
nftables-rules-config:
|
|
file.managed:
|
|
- name: {{ nftables.config_dir }}/rules.nft
|
|
- source: salt://nftables/templates/rules.nft.j2
|
|
- template: jinja
|
|
- watch_in:
|
|
- service: nftables-service
|
|
- require:
|
|
- pkg: nftables-pkg
|
|
- file: nftables-config-dir
|
|
|
|
nftables-main-config:
|
|
file.managed:
|
|
- name: /etc/nftables.conf
|
|
- source: salt://nftables/templates/nftables.conf.j2
|
|
- template: jinja
|
|
- watch_in:
|
|
- service: nftables-service
|
|
- require:
|
|
- file: nftables-rules-config
|
|
- pkg: nftables-pkg
|
|
|
|
nftables-config-check:
|
|
cmd.run:
|
|
- name: nft -c -f /etc/nftables.conf
|
|
- stateful: True
|