role(headscale): set firewall+add handler

This commit is contained in:
surtur 2023-08-02 20:43:50 +02:00
parent 202f2e2e29
commit 4a212bde39
Signed by: wanderer
SSH Key Fingerprint: SHA256:MdCZyJ2sHLltrLBp0xQO0O1qTW9BT/xl5nXkDvhlMCI
2 changed files with 28 additions and 6 deletions

@ -0,0 +1,7 @@
---
- name: Restart caddy-hs
ansible.builtin.systemd:
name: caddy-hs
state: restarted
when: caddyfile.changed or caddysystemd.changed
...

@ -59,6 +59,26 @@
- "%s" - "%s"
register: caddyfile register: caddyfile
- name: Enable services in the firewall
ansible.posix.firewalld:
zone: "{{ firewalld_default_zone }}"
service: "{{ item }}"
permanent: true
immediate: true
state: enabled
with_items:
- http
- https
when: "firewalld_configure"
- name: Expose gRPC
ansible.posix.firewalld:
port: 50443/tcp
permanent: true
immediate: true
state: enabled
when: "firewalld_configure"
# - name: Install xcaddy # - name: Install xcaddy
# ansible.builtin.command: # ansible.builtin.command:
# cmd: > # cmd: >
@ -100,12 +120,7 @@
state: started state: started
enabled: true enabled: true
daemon_reload: true daemon_reload: true
notify: Restart caddy-hs
- name: Restart caddy-hs
ansible.builtin.systemd:
name: caddy-hs
state: restarted
when: caddyfile.changed or caddysystemd.changed
- name: Fetch crt,key - name: Fetch crt,key
ansible.builtin.fetch: ansible.builtin.fetch: