homelab/roles/mastodon/tasks/start_web_server.yml

43 lines
1.2 KiB
YAML

---
- name: Disable web server in haproxy
become: true
community.general.haproxy:
socket: /run/haproxy/admin.sock
state: disabled
drain: true
wait: true
backend: mastodon
host: s{{ server_idx }}
fail_on_not_found: true
- name: Create web container
become: true
community.docker.docker_container:
name: mastodon-web-{{ server_idx }}
image: ghcr.io/mastodon/mastodon:{{ version }}
env_file: /etc/mastodon/.env
command: ["bundle", "exec", "puma", "-C", "config/puma.rb"]
networks:
- name: mastodon
- name: postgresql
- name: minio
- name: haproxy
- name: authentik
volumes:
- mastodon-public-system:/mastodon/public/system
restart_policy: unless-stopped
healthcheck:
test: ["CMD", "curl", "--fail", "127.0.0.1:3000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
# TODO: enable after ansible update
# state: healthy
- name: Enable web server in haproxy
become: true
community.general.haproxy:
socket: /run/haproxy/admin.sock
state: enabled
backend: mastodon
host: s{{ server_idx }}
fail_on_not_found: true