--- - name: Ensure old Cloudsmith repository artifact is removed ansible.builtin.file: path: /etc/apt/sources.list.d/caddy-stable.list state: absent become: yes - name: Install Caddy server package from official Debian repositories ansible.builtin.apt: name: caddy state: present update_cache: yes become: yes - name: Deploy Caddyfile configuration from template ansible.builtin.template: src: Caddyfile.j2 dest: /etc/caddy/Caddyfile owner: caddy group: caddy mode: '0644' become: yes notify: Restart Caddy - name: Ensure Caddy service is enabled and running ansible.builtin.systemd: name: caddy state: started enabled: yes become: yes