ansible/privfrontends/playbook.yaml

39 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: "{{ item.value }}"
app_name: "{{ item.key | lower }}"
configs_dir_local: "./configs/{{ item.key }}"
loop: "{{ apps.groups | default({}) | dict2items }}"
when: item.value.docker_settings
tags: docker