--- # install caddy as a docker stack - name: Ensure Caddyfile directory exists ansible.builtin.file: path: "{{ caddy_caddyfile_dir }}" state: directory mode: "0755" become: true tags: - fs - name: Ensure Caddyfile exists ansible.builtin.template: src: config.json.j2 dest: "{{ caddy_caddyfile_dir }}/config.json" validate: "docker run --rm -v %s:/config.json peterdavehello/jsonlint jsonlint -q /config.json" become: true tags: - fs - name: Deploy caddy to swarm community.general.docker_stack: name: "{{ caddy_stack.name }}" state: present prune: yes compose: - "{{ caddy_stack.compose }}" when: caddy_stack is defined become: true tags: - docker-swarm # TODO FIXME UP # - name: Allow access to services # firewalld: # service: "{{ item }}" # permanent: true # state: enabled # with_items: # - http # - https # become: true # tags: # - firewall