ansible/privfrontends/playbook.yaml

40 lines
1.0 KiB
YAML
Raw Normal View History

2023-05-13 06:44:40 +05:30
---
- name: Setup Caddy
2023-09-14 14:42:16 +05:30
hosts: privfrontends
2023-05-13 06:44:40 +05:30
tasks:
- name: Copy Caddyfile
2023-07-07 22:40:54 +05:30
ansible.builtin.template:
src: ./templates/Caddyfile.j2
dest: /etc/caddy/Caddyfile
2023-07-07 22:40:54 +05:30
mode: preserve
tags: caddy-non-update
2023-05-13 06:44:40 +05:30
- name: Copy per-server caddy extras
2023-07-07 22:40:54 +05:30
ansible.builtin.copy:
2023-05-29 14:08:34 +05:30
src: "./templates/{{ inventory_hostname }}/"
dest: /etc/caddy/
directory_mode: true
2023-07-07 22:40:54 +05:30
mode: preserve
tags: caddy-non-update
- name: Reload Caddy
2023-07-07 22:40:54 +05:30
ansible.builtin.service:
2023-05-29 21:19:16 +05:30
name: caddy
2023-07-07 22:40:54 +05:30
enabled: true
state: reloaded
tags: caddy-non-update
- name: Docker
2023-05-14 15:56:43 +05:30
hosts: privfrontends
vars_files:
- ./vars.yaml
2023-07-07 22:40:54 +05:30
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