init
This commit is contained in:
commit
883f31932e
169 changed files with 5676 additions and 0 deletions
46
ansible/roles/authentik/tasks/restore-authentik.yml
Normal file
46
ansible/roles/authentik/tasks/restore-authentik.yml
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
---
|
||||
-
|
||||
name: Set backup staging directory
|
||||
set_fact:
|
||||
_authentik_backup_dir: "{{ backup_staging_dir | default('/var/backups') }}/authentik"
|
||||
|
||||
-
|
||||
name: Stop Authentik stack
|
||||
community.docker.docker_compose_v2:
|
||||
project_src: "{{ install_dir }}"
|
||||
state: absent
|
||||
|
||||
-
|
||||
name: Restore config files
|
||||
copy:
|
||||
src: "{{ _authentik_backup_dir }}/{{ item }}"
|
||||
dest: "{{ install_dir }}/{{ item }}"
|
||||
remote_src: yes
|
||||
mode: "0600"
|
||||
loop:
|
||||
- .env
|
||||
- docker-compose.yml
|
||||
|
||||
-
|
||||
name: Start Postgres only
|
||||
command: >
|
||||
docker compose -f {{ install_dir }}/docker-compose.yml
|
||||
up -d postgres
|
||||
|
||||
-
|
||||
name: Wait for Postgres to be ready
|
||||
pause:
|
||||
seconds: 10
|
||||
|
||||
-
|
||||
name: Restore Postgres dump
|
||||
shell: >
|
||||
docker compose -f {{ install_dir }}/docker-compose.yml
|
||||
exec -T postgres psql -U authentik authentik
|
||||
< {{ _authentik_backup_dir }}/authentik.sql
|
||||
|
||||
-
|
||||
name: Start full Authentik stack
|
||||
community.docker.docker_compose_v2:
|
||||
project_src: "{{ install_dir }}"
|
||||
state: present
|
||||
Loading…
Add table
Add a link
Reference in a new issue