clustered-fucks/playbooks/deploy-db-admin-tools.yml
Maddox 800166c2ac Fix download-stack healthchecks to test external connectivity
The localhost healthchecks didn't detect when gluetun's network
namespace died - services still responded locally but couldn't
reach the internet. Changed healthchecks to curl http://1.1.1.1
which requires the VPN tunnel to be working.

Also adds phpmyadmin, phppgadmin compose files and deploy playbook.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 12:39:36 +00:00

104 lines
3.3 KiB
YAML

---
# Deploy Database Admin Tools to databases VM
# Deploys: phpmyadmin, phppgadmin
# Target: databases (192.168.1.81)
- name: Deploy Database Admin Tools
hosts: databases
vars:
appdata_path: /home/docker/appdata
compose_src: "{{ playbook_dir }}/../compose-files/databases"
tasks:
# =========================================================================
# PHPMYADMIN
# =========================================================================
- name: Create phpmyadmin directory
ansible.builtin.file:
path: "{{ appdata_path }}/phpmyadmin"
state: directory
mode: '0755'
- name: Copy phpmyadmin docker-compose.yml
ansible.builtin.copy:
src: "{{ compose_src }}/phpmyadmin/docker-compose.yml"
dest: "{{ appdata_path }}/phpmyadmin/docker-compose.yml"
mode: '0644'
- name: Deploy phpmyadmin container
community.docker.docker_compose_v2:
project_src: "{{ appdata_path }}/phpmyadmin"
state: present
pull: always
register: phpmyadmin_result
- name: Show phpmyadmin status
ansible.builtin.debug:
msg: "phpMyAdmin deployed: {{ phpmyadmin_result.changed }}"
# =========================================================================
# PHPPGADMIN
# =========================================================================
- name: Create phppgadmin directory
ansible.builtin.file:
path: "{{ appdata_path }}/phppgadmin"
state: directory
mode: '0755'
- name: Create phppgadmin data directory
ansible.builtin.file:
path: "{{ appdata_path }}/phppgadmin/data"
state: directory
mode: '0755'
- name: Create phppgadmin logs directory
ansible.builtin.file:
path: "{{ appdata_path }}/phppgadmin/logs"
state: directory
mode: '0755'
- name: Copy phppgadmin docker-compose.yml
ansible.builtin.copy:
src: "{{ compose_src }}/phppgadmin/docker-compose.yml"
dest: "{{ appdata_path }}/phppgadmin/docker-compose.yml"
mode: '0644'
- name: Deploy phppgadmin container
community.docker.docker_compose_v2:
project_src: "{{ appdata_path }}/phppgadmin"
state: present
pull: always
register: phppgadmin_result
- name: Show phppgadmin status
ansible.builtin.debug:
msg: "phpPgAdmin deployed: {{ phppgadmin_result.changed }}"
# =========================================================================
# VERIFICATION
# =========================================================================
- name: Wait for phpmyadmin to be ready
ansible.builtin.uri:
url: "http://localhost:2500"
status_code: 200
timeout: 5
register: pma_health
retries: 10
delay: 5
until: pma_health.status == 200
- name: Wait for phppgadmin to be ready
ansible.builtin.uri:
url: "http://localhost:5183"
status_code: [200, 302]
timeout: 5
register: pga_health
retries: 10
delay: 5
until: pga_health.status in [200, 302]
- name: Summary
ansible.builtin.debug:
msg:
- "✅ phpMyAdmin: http://192.168.1.81:2500"
- "✅ phpPgAdmin: http://192.168.1.81:5183"