role(headscale): set firewall+add handler
This commit is contained in:
parent
202f2e2e29
commit
4a212bde39
7
ansible/roles/headscale/handlers/main.yml
Normal file
7
ansible/roles/headscale/handlers/main.yml
Normal file
@ -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:
|
||||||
|
Loading…
Reference in New Issue
Block a user