- Delete grafana provisioning templates (grafana/loki removed) - Delete env.outline.j2 (Outline replaced by Docmost) - Remove duplicate MinIO bucket creation Ansible task (plane-createbuckets compose service handles this more reliably) - Update CLAUDE.md: single server, correct domains, remove tools references
90 lines
2.7 KiB
YAML
90 lines
2.7 KiB
YAML
---
|
|
- import_tasks: directories.yml
|
|
- import_tasks: configs.yml
|
|
|
|
- name: Pull Docker images one by one
|
|
ansible.builtin.command: docker pull {{ item }}
|
|
loop:
|
|
- "{{ traefik_image }}"
|
|
- "{{ forgejo_image }}"
|
|
- "{{ forgejo_db_image }}"
|
|
- "{{ plane_frontend_image }}"
|
|
- "{{ plane_admin_image }}"
|
|
- "{{ plane_space_image }}"
|
|
- "{{ plane_backend_image }}"
|
|
- "{{ plane_db_image }}"
|
|
- "{{ plane_redis_image }}"
|
|
- "{{ plane_minio_image }}"
|
|
- "{{ act_runner_image }}"
|
|
- "{{ crowdsec_image }}"
|
|
- "{{ docmost_image }}"
|
|
- "{{ docmost_db_image }}"
|
|
- "{{ docmost_redis_image }}"
|
|
- "{{ n8n_image }}"
|
|
register: pull_result
|
|
changed_when: "'Status: Downloaded newer image' in pull_result.stdout"
|
|
retries: 5
|
|
delay: 30
|
|
until: pull_result.rc == 0
|
|
|
|
- name: Deploy Docker Compose stack
|
|
community.docker.docker_compose_v2:
|
|
project_src: "{{ services_root }}"
|
|
state: present
|
|
pull: never
|
|
remove_orphans: true
|
|
retries: 3
|
|
delay: 15
|
|
register: compose_result
|
|
until: compose_result is succeeded
|
|
notify: Stack deployed
|
|
|
|
# ── Forgejo Discord webhooks (deploys → #deploys channel) ────────────────────
|
|
- name: Check Discord webhooks on Forgejo repos
|
|
ansible.builtin.uri:
|
|
url: "https://{{ domain_git }}/api/v1/repos/jack/{{ item }}/hooks"
|
|
method: GET
|
|
headers:
|
|
Authorization: "token {{ forgejo_api_token }}"
|
|
status_code: 200
|
|
register: forgejo_hooks
|
|
failed_when: false
|
|
changed_when: false
|
|
loop:
|
|
- infra
|
|
- discord-bot
|
|
|
|
- name: Create Discord webhook on Forgejo repos
|
|
ansible.builtin.uri:
|
|
url: "https://{{ domain_git }}/api/v1/repos/jack/{{ item.item }}/hooks"
|
|
method: POST
|
|
headers:
|
|
Authorization: "token {{ forgejo_api_token }}"
|
|
Content-Type: "application/json"
|
|
body_format: json
|
|
body:
|
|
type: "discord"
|
|
config:
|
|
url: "{{ discord_webhook_deploys }}"
|
|
content_type: "json"
|
|
username: "Forgejo"
|
|
icon_url: ""
|
|
events: ["push", "create"]
|
|
active: true
|
|
status_code: 201
|
|
when: >
|
|
item.status == 200 and
|
|
(item.json | selectattr('type', 'eq', 'discord') | list | length == 0)
|
|
loop: "{{ forgejo_hooks.results }}"
|
|
loop_control:
|
|
label: "{{ item.item }}"
|
|
|
|
# ── Docmost: wait for healthy ────────────────────────────────────────────────
|
|
- name: Wait for Docmost container to be healthy
|
|
ansible.builtin.command: >
|
|
docker inspect --format='{{ '{{' }}.State.Health.Status{{ '}}' }}' docmost
|
|
register: docmost_health
|
|
changed_when: false
|
|
retries: 30
|
|
delay: 10
|
|
until: docmost_health.stdout == 'healthy'
|