--- - name: Install Caddy packages community.general.pacman: name: caddy state: present - name: Configure Caddy template: src: Caddyfile.j2 dest: /etc/caddy/Caddyfile lstrip_blocks: true register: caddy_config - name: Restart Caddy service service: name: caddy state: restarted when: caddy_config.changed - name: Enable Caddy service service: name: caddy state: started enabled: yes