cloudserve-infrastructure/roles/caddy/tasks/main.yml
Marty Oehme 6de8f0fb50
Add testing inventory and group variables
Added fully test-ready inventory and groups using vagrant and able to
run repeatedly as necessary.
2021-07-29 15:11:28 +02:00

33 lines
742 B
YAML

---
# 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: Caddyfile.j2
dest: "{{ caddy_caddyfile_dir }}/Caddyfile"
validate: "docker run --rm -v %s:/Caddyfile caddy caddy validate --config /Caddyfile"
become: true
tags:
- fs
- name: Deploy caddy to swarm
community.general.docker_stack:
name: "{{ item.name }}"
state: present
prune: yes
compose:
- "{{ item.compose }}"
with_items: "{{ caddy_stack }}"
when: caddy_stack is defined
become: yes
tags:
- docker-swarm