Enable sigvild-gallery role and backup functionality
- Enable sigvild-gallery role in site.yml playbook - Add backup configuration to host variables - Integrate restore functionality into main sigvild-gallery tasks - Add data protection logic to prevent accidental overwrites - Enable gitea role for complete service deployment This completes the sigvild-gallery service integration with backup/restore capabilities.
This commit is contained in:
@@ -26,6 +26,47 @@
|
||||
- "{{ sigvild_gallery_data_dir }}"
|
||||
- "{{ sigvild_gallery_web_root }}"
|
||||
|
||||
- name: Check for existing gallery data
|
||||
stat:
|
||||
path: "{{ sigvild_gallery_data_dir }}/data.db"
|
||||
register: existing_gallery_data
|
||||
tags: [restore, backend]
|
||||
|
||||
- name: Check for available backup files
|
||||
local_action:
|
||||
module: find
|
||||
paths: "{{ sigvild_gallery_backup_local_path }}"
|
||||
patterns: "sigvild-gallery-backup-*.tar.gz"
|
||||
register: backup_files
|
||||
become: false
|
||||
when: sigvild_gallery_backup_enabled | default(false)
|
||||
tags: [restore, backend]
|
||||
|
||||
- name: Initialize backup_files when backup disabled
|
||||
set_fact:
|
||||
backup_files: {"files": []}
|
||||
when: not (sigvild_gallery_backup_enabled | default(false))
|
||||
|
||||
- name: Restore from backup if no data exists and backups available
|
||||
include_tasks: restore.yml
|
||||
when:
|
||||
- sigvild_gallery_backup_enabled | default(false)
|
||||
- backup_files.files | length > 0
|
||||
- not existing_gallery_data.stat.exists
|
||||
tags: [restore, backend]
|
||||
|
||||
- name: Skip restore - existing data found
|
||||
debug:
|
||||
msg:
|
||||
- "ℹ️ Existing gallery data found at {{ sigvild_gallery_data_dir }}/data.db"
|
||||
- "Skipping restore to preserve existing data"
|
||||
- "To force restore, manually remove existing data first"
|
||||
when:
|
||||
- sigvild_gallery_backup_enabled | default(false)
|
||||
- backup_files.files | length > 0
|
||||
- existing_gallery_data.stat.exists
|
||||
tags: [restore, backend]
|
||||
|
||||
- name: Build and deploy backend
|
||||
include_tasks: deploy_backend.yml
|
||||
tags: [backend, build]
|
||||
|
||||
Reference in New Issue
Block a user