You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible-homelab/ansible/homelab/playbooks/restore-all.yml

47 lines
1.4 KiB
YAML

###
# restore-all restores a manually specified list of volumes.
# This is intended for user when initially setting up a home lab environment
# and want to restore all applications from existing backups
#
# Restores will be skipped if there is no archive in the backup directory.
#
# If a container exists, it will be stopped, restored and started
# If a container does not exist, the volume will be still be created.
###
# TODO: here instead we can probably iterate through all containers with the backup label.
---
- name: Redeploy Portainer and All Volumes
hosts: servers
vars_files:
- ../variables.yml
- ~/.homelab/variables.yml
tasks:
- name: Restore Portainer
import_tasks: ../tasks/restore-volume-tasks.yml
vars:
container_name: "portainer"
- name: Restore Linkding
import_tasks: ../tasks/restore-volume-tasks.yml
vars:
container_name: "linkding"
- name: Start Linkding Stack
import_tasks: ../tasks/create-stack-tasks.yml
vars:
container_name: "linkding"
stack_name: "linkding"
- name: Restore Nginx Proxy Manager
import_tasks: ../tasks/restore-volume-tasks.yml
vars:
container_name: "nginx-proxy-manager"
- name: Start Nginx Proxy Manager
import_tasks: ../tasks/create-stack-tasks.yml
vars:
container_name: "nginx-proxy-manager"
stack_name: "nginx-proxy-manager"