ufw
change
commit ccecbe837852897d243779586e265ee3cdfa35b5
author Alpha Chen <alpha@kejadlen.dev>
date
parent dac82c11
diff --git a/lotus-land-story/main.yml b/lotus-land-story/main.yml
index 9833b81..e5c59d2 100644
--- a/lotus-land-story/main.yml
+++ b/lotus-land-story/main.yml
@@ -101,34 +101,7 @@
 - import_playbook: loki.yml        # noqa: name[play]
 - import_playbook: miniflux.yml    # noqa: name[play]
 - import_playbook: gotosocial.yml  # noqa: name[play]
-
 - import_playbook: caddy.yml       # noqa: name[play]
-
-- name: Set up ufw
-  hosts: lotus-land-story
-  tags:
-    - ufw
-  tasks:
-
-    - name: Get docker network for ufw
-      community.docker.docker_network:
-        name: lotus_land_story
-      register: docker_network
-
-    - name: Allow access from docker network
-      community.general.ufw:
-        rule: allow
-        from_ip: "{{ docker_network.network.IPAM.Config[0].Subnet }}"
-      notify: Reload ufw
-
-    - name: Allow SSH access
-      community.general.ufw:
-        rule: allow
-        name: OpenSSH
-      notify: Reload ufw
-
-  handlers:
-    - name: Import restarts
-      ansible.builtin.import_tasks: restarts.yml
+- import_playbook: ufw.yml         # noqa: name[play]
 
 # vim: ft=yaml.ansible
diff --git a/lotus-land-story/ufw.yml b/lotus-land-story/ufw.yml
new file mode 100644
index 0000000..cb466c4
--- /dev/null
+++ b/lotus-land-story/ufw.yml
@@ -0,0 +1,26 @@
+- name: Set up ufw
+  hosts: lotus-land-story
+  tasks:
+
+    - name: Get docker network for ufw
+      community.docker.docker_network:
+        name: lotus_land_story
+      register: docker_network
+
+    - name: Allow access from docker network
+      community.general.ufw:
+        rule: allow
+        from_ip: "{{ docker_network.network.IPAM.Config[0].Subnet }}"
+      notify: Reload ufw
+
+    - name: Allow SSH access
+      community.general.ufw:
+        rule: allow
+        name: OpenSSH
+      notify: Reload ufw
+
+  handlers:
+    - name: Import restarts
+      ansible.builtin.import_tasks: restarts.yml
+
+# vim: ft=yaml.ansible