Migrate sigvild-gallery to production environment

- Add multi-environment architecture (homelab + production)
- Create production environment (mini-vps) for client projects
- Create homelab playbook for arch-vps services
- Create production playbook for mini-vps services
- Move sigvild-gallery from homelab to production
- Restructure variables: group_vars/production + host_vars/arch-vps
- Add backup-sigvild.yml playbook with auto-restore functionality
- Fix restore logic to check for data before creating directories
- Add manual variable loading workaround for Ansible 2.20
- Update all documentation for multi-environment setup
- Add ADR-007 documenting multi-environment architecture decision
This commit is contained in:
2025-12-15 16:33:33 +01:00
parent e8b76c6a72
commit ecbeb07ba2
18 changed files with 553 additions and 213 deletions

View File

@@ -0,0 +1,24 @@
---
# Sigvild Gallery Data Backup Playbook
#
# This playbook creates a backup of the Sigvild Gallery data including:
# - PocketBase SQLite database (data.db, auxiliary.db)
# - All uploaded wedding photos and media files
# - PocketBase logs and system state
#
# Usage:
# ansible-playbook playbooks/backup-sigvild.yml -l arch-vps
# ansible-playbook playbooks/backup-sigvild.yml -l mini-vps
#
# Backup location: ~/sigvild-gallery-backup/sigvild-gallery-backup-YYYYMMDDTHHMMSS.tar.gz
- name: Backup Sigvild Gallery Data
hosts: all
become: true
gather_facts: true
tasks:
- name: Run backup tasks from sigvild-gallery role
include_role:
name: sigvild-gallery
tasks_from: backup.yml

64
playbooks/homelab.yml Normal file
View File

@@ -0,0 +1,64 @@
---
# Homelab Infrastructure Deployment
#
# Deploys personal homelab services to arch-vps including:
# - PostgreSQL database
# - Valkey cache/session store
# - Podman container runtime
# - Caddy web server
# - Nextcloud cloud storage
# - Authentik SSO/authentication
# - Gitea git hosting
#
# Usage:
# ansible-playbook playbooks/homelab.yml
- name: Deploy Homelab Infrastructure
hosts: homelab
become: true
gather_facts: true
tasks:
# Workaround: Manually load host_vars due to Ansible 2.20 variable loading issue
- name: Load homelab host variables
include_vars:
dir: "{{ playbook_dir }}/../host_vars/{{ inventory_hostname }}"
extensions: ['yml']
tags: always
# Deploy infrastructure services
- name: Deploy PostgreSQL
include_role:
name: postgresql
tags: ['postgresql', 'infrastructure', 'database']
- name: Deploy Valkey
include_role:
name: valkey
tags: ['valkey', 'redis', 'infrastructure', 'cache']
- name: Deploy Podman
include_role:
name: podman
tags: ['podman', 'containers', 'infrastructure']
- name: Deploy Caddy
include_role:
name: caddy
tags: ['caddy', 'infrastructure', 'web']
# Deploy application services
- name: Deploy Nextcloud
include_role:
name: nextcloud
tags: ['nextcloud', 'cloud', 'storage']
- name: Deploy Authentik
include_role:
name: authentik
tags: ['authentik', 'sso', 'auth']
- name: Deploy Gitea
include_role:
name: gitea
tags: ['gitea', 'git', 'development']

29
playbooks/production.yml Normal file
View File

@@ -0,0 +1,29 @@
---
# Production Services Deployment
#
# Deploys production services requiring high uptime to mini-vps including:
# - Caddy web server
# - Sigvild Gallery (wedding photo gallery)
#
# Usage:
# ansible-playbook playbooks/production.yml
# - import_playbook: security.yml
- name: Deploy Production Services
hosts: production
become: true
gather_facts: true
tasks:
# Workaround: Manually load group_vars due to Ansible 2.20 variable loading issue
- name: Load production group variables
include_vars:
dir: "{{ playbook_dir }}/../group_vars/production"
extensions: ['yml']
tags: always
- name: Deploy Sigvild Gallery
include_role:
name: sigvild-gallery
tags: ['sigvild', 'gallery', 'wedding']