diff --git a/ansible/roles/headscale/tasks/main.yml b/ansible/roles/headscale/tasks/main.yml index e21adcd..05f3154 100644 --- a/ansible/roles/headscale/tasks/main.yml +++ b/ansible/roles/headscale/tasks/main.yml @@ -114,6 +114,8 @@ loop: - crt - key + when: caddyfile.changed or caddysystemd.changed + register: fetchcrt - name: Copy to altcrtpath ansible.builtin.copy: @@ -122,6 +124,7 @@ loop: - crt - key + when: fetchcrt.changed - name: Run headscale container containers.podman.podman_container: @@ -140,6 +143,7 @@ command: headscale serve vars: crtpath: "{{ headscale.altcrtpath }}/{{ headscale.dns.base_domain }}" + when: caddyfile.changed or caddysystemd.changed or fetchcrt.changed - name: Run headscale-ui container containers.podman.podman_container: @@ -149,4 +153,5 @@ image: "ghcr.io/gurucomputing/headscale-ui:{{ headscale.ui.version }}" ports: "{{ headscale.ui.ports }}" restart_policy: always + when: caddyfile.changed or caddysystemd.changed or fetchcrt.changed ...