--- - name: Install dependencies apt: name: - curl - unzip - git - build-essential - golang - debian-keyring - debian-archive-keyring - apt-transport-https state: present update_cache: yes - name: reverseproxy | xcaddy | download key ansible.builtin.uri: url: "https://dl.cloudsmith.io/public/caddy/xcaddy/gpg.key" dest: "/tmp/xcaddy_gpg.key" creates: "/tmp/xcaddy_gpg.key" - name: reverseproxy | xcaddy | verify and import key ansible.builtin.shell: cmd: "gpg --show-keys --with-fingerprint --with-colons /tmp/xcaddy_gpg.key 2>&1 | grep -q '^fpr:\\+65760C51EDEA2017CEA2CA15155B6D79CA56EA34:$' && cat /tmp/xcaddy_gpg.key | gpg --dearmor | tee /etc/apt/keyrings/xcaddy_gpg.gpg > /dev/null" creates: "/etc/apt/trusted.gpg.d/xcaddy_gpg.gpg" - name: reverseproxy | caddy | add repository ansible.builtin.uri: url: "https://dl.cloudsmith.io/public/caddy/xcaddy/debian.deb.txt" dest: "/etc/apt/sources.list.d/xcaddy-stable.list" creates: "/etc/apt/sources.list.d/xcaddy-stable.list" - name: reverseproxy | xcaddy | install xcaddy ansible.builtin.apt: name: "xcaddy" state: latest update_cache: yes - name: Build Caddy with PowerDNS DNS plugin command: > xcaddy build --with github.com/caddy-dns/powerdns args: chdir: /usr/local/bin creates: /usr/local/bin/caddy-custom - name: Move custom caddy binary copy: src: /usr/local/bin/caddy dest: /usr/local/bin/caddy mode: 0755 remote_src: yes