oopen-server/roles/firewall/templates/etc/systemd/system/ipt-firewall.service.j2
2021-09-05 02:25:16 +02:00

36 lines
688 B
Django/Jinja

{{ ansible_managed | comment }}
{%- if groups['gateway_server']|string is search(inventory_hostname) %}
[Unit]
Description=IPv4 Firewall with iptables
After=network.target
[Service]
SyslogIdentifier="ipt-gateway"
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/local/sbin/ipt-firewall-gateway start
ExecStop=/usr/local/sbin/ipt-firewall-gateway stop
User=root
[Install]
WantedBy=multi-user.target
{% else %}
[Unit]
Description=IPv4 Firewall with iptables
After=network.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/local/sbin/ipt-firewall-server start
ExecStop=/usr/local/sbin/ipt-firewall-server stop
User=root
[Install]
WantedBy=multi-user.target
{% endif %}