ctucx.git: ansible-configs

My personal ansible roles and playbooks [deprecated in favor of nixos]

commit 024b16c829b969332a15c5ba42ed24e28529d268
parent e31eac0af7a4a00b5cfb11cbb0c2ea4f63cc8c43
Author: Leah (ctucx) <leah@ctu.cx>
Date: Sun, 21 Feb 2021 16:28:31 +0100

roles/syncthing: fix some stuff
2 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/roles/syncthing/tasks/configure.yml b/roles/syncthing/tasks/configure.yml
@@ -21,6 +21,7 @@
     state: restarted
   when:
     - ansible_service_mgr == "openrc"
+    - network.nftables.enable is true
 
 - name: "[systemd] Restart service: nftables"
   systemd:
diff --git a/roles/syncthing/tasks/remove.yml b/roles/syncthing/tasks/remove.yml
@@ -90,3 +90,20 @@
   with_items:
     - "/etc/init.d/syncthing-{{ services.syncthing.user }}"
     - "/etc/nginx/conf.d/syncthing.conf"
+    - "/etc/nftables.d/syncthing.nft"
+
+- name: "[OpenRC] Restart service: nftables"
+  service:
+    name: nftables
+    state: restarted
+  when:
+    - ansible_service_mgr == "openrc"
+    - network.nftables.enable is true
+
+- name: "[systemd] Restart service: nftables"
+  systemd:
+    name: nftables
+    state: restarted
+  when:
+    - ansible_service_mgr == "systemd"
+    - network.nftables.enable is true