--- - 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