- name: Set up Caddy hosts: lotus-land-story vars_files: - vars.yml tasks: - name: Make /mnt/lotus-land-story/caddy ansible.builtin.file: path: /mnt/lotus-land-story/{{ item }} state: directory mode: "0755" loop: - caddy - caddy/data - name: Set up Caddyfile ansible.builtin.template: src: templates/Caddyfile dest: /mnt/lotus-land-story/caddy/Caddyfile mode: "0644" - name: Create Caddy volume community.docker.docker_volume: name: caddy - name: Run Caddy community.docker.docker_container: # recreate: true # restart: true name: caddy image: caddy:2 ports: - "80:80" - "443:443" - "443:443/udp" - "2019:2019" volumes: - /mnt/lotus-land-story/caddy/Caddyfile:/etc/caddy/Caddyfile - /mnt/lotus-land-story/caddy/data:/data - caddy-config:/config restart_policy: unless-stopped networks: - name: lotus_land_story etc_hosts: host.docker.internal: host-gateway handlers: - name: Import restarts ansible.builtin.import_tasks: restarts.yml # vim: ft=yaml.ansible