ansible/privfrontends/playbook.yaml

40 lines
1.0 KiB
YAML

---
- name: Setup Caddy
hosts: privfrontends
tasks:
- name: Copy Caddyfile
ansible.builtin.template:
src: ./templates/Caddyfile.j2
dest: /etc/caddy/Caddyfile
mode: preserve
tags: caddy-non-update
- name: Copy per-server caddy extras
ansible.builtin.copy:
src: "./templates/{{ inventory_hostname }}/"
dest: /etc/caddy/
directory_mode: true
mode: preserve
tags: caddy-non-update
- name: Reload Caddy
ansible.builtin.service:
name: caddy
enabled: true
state: reloaded
tags: caddy-non-update
- name: Docker
hosts: privfrontends
vars_files:
- ./vars.yaml
tasks:
- name: Deploy stack role
ansible.builtin.include_role:
name: gi-yt.docker_compose_declarative
vars:
app: "{{ service.value }}"
app_name: "{{ service.key | lower }}"
loop: "{{ apps.groups | default({}) | dict2items }}"
loop_control:
loop_var: service
when: service.value.docker_settings
tags: docker