paulbsd-salt/states/nftables/config.sls

33 lines
804 B
Plaintext
Raw Permalink Normal View History

2022-01-02 17:16:29 +01:00
---
{%- 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
2022-01-06 23:18:36 +01:00
- source: salt://nftables/templates/rules.nft.j2
2022-01-02 17:16:29 +01:00
- template: jinja
- watch_in:
- service: nftables-service
- require:
- pkg: nftables-pkg
- file: nftables-config-dir
nftables-main-config:
file.managed:
- name: /etc/nftables.conf
2022-01-06 23:18:36 +01:00
- source: salt://nftables/templates/nftables.conf.j2
2022-01-02 17:16:29 +01:00
- template: jinja
- watch_in:
- service: nftables-service
- require:
- file: nftables-rules-config
- pkg: nftables-pkg
2024-09-25 21:07:13 +02:00
nftables-config-check:
cmd.run:
2024-09-25 21:12:11 +02:00
- name: nft -c -f /etc/nftables.conf
2024-09-25 21:07:13 +02:00
- stateful: True