Files
e-ticket/ansible/deploy-caddy.yml
Serreau Jovann 507500e20d Update deployment pipeline, Makefile and README
- Makefile: add install_dev, install_prod, migrations, clear_prod, maintenance commands
- Playbook: full deploy flow (maintenance, stop, install, start, migrate, clear, caddy, messenger)
- Supervisor config for 2 messenger instances
- Workflow: SSH key setup with server IP
- hosts.ini: use IP instead of domain, sudo without password
- README: full documentation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 20:52:01 +01:00

80 lines
1.7 KiB
YAML

---
- name: Deploy Caddy config for e-ticket
hosts: production
become: true
vars_files:
- vault.yml
pre_tasks:
- name: Enable maintenance mode
command: make maintenance_on
args:
chdir: /var/www/e-ticket
tasks:
- name: Ensure Caddy sites directory exists
file:
path: /etc/caddy/sites
state: directory
owner: root
group: root
mode: "0755"
- name: Stop production containers
command: make stop_prod
args:
chdir: /var/www/e-ticket
- name: Install dependencies and build assets
command: make install_prod
args:
chdir: /var/www/e-ticket
- name: Start production containers
command: make start_prod
args:
chdir: /var/www/e-ticket
- name: Run migrations
command: make migrate_prod
args:
chdir: /var/www/e-ticket
- name: Clear cache
command: make clear_prod
args:
chdir: /var/www/e-ticket
- name: Deploy Caddy config
template:
src: caddy.j2
dest: /etc/caddy/sites/e-ticket.conf
owner: root
group: root
mode: "0644"
notify: Reload Caddy
- name: Deploy Messenger supervisor config
template:
src: messenger.j2
dest: /etc/supervisor/conf.d/e-ticket.conf
owner: root
group: root
mode: "0644"
notify: Reload Supervisor
post_tasks:
- name: Disable maintenance mode
command: make maintenance_off
args:
chdir: /var/www/e-ticket
handlers:
- name: Reload Caddy
systemd:
name: caddy
state: reloaded
- name: Reload Supervisor
command: supervisorctl reread && supervisorctl update