Add nat configuration service unit

This commit is contained in:
John Burwell 2025-04-26 16:58:45 -05:00
parent c867d567e2
commit 1031d8311d
2 changed files with 27 additions and 0 deletions

View File

@ -45,3 +45,18 @@
src: ham-hotspot-nat.nft.j2
mode: "0644"
notify: Restart nftables
# Install ham-hotspot-nat.service
- name: Install ham-hotspot-nat.service
ansible.builtin.template:
dest: /etc/systemd/system/ham-hotspot-nat.service
src: ham-hotspot-nat.service.j2
mode: "0644"
notify: Reload systemd
# Enable and start ham-hotspot-nat.service
- name: Enable and start ham-hotspot-nat.service
ansible.builtin.systemd:
name: ham-hotspot-nat.service
enabled: true
state: started

View File

@ -0,0 +1,12 @@
[Unit]
Description=Ham Hotspot NAT Configuration
After=network-online.target
Wants=network-online.target
[Service]
Type=oneshot
ExecStart=/sbin/nft -f /etc/nftables.d/10-ham-hotspot-nat.nft
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target