fix: Copy flow scripts into container before executing them

The flows.yml task was trying to execute Python scripts inside the
container before copying them in with docker cp. This caused the
'No such file or directory' error on fresh deployments.

Fixed by reordering tasks to:
1. Copy scripts to host /tmp
2. Docker cp into container
3. Execute scripts inside container

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Pieter 2026-01-13 10:55:14 +01:00
parent 8c3553d89f
commit 5b38c4b5b4

View file

@ -17,6 +17,12 @@
dest: /tmp/create_invitation_flow.py dest: /tmp/create_invitation_flow.py
mode: '0755' mode: '0755'
- name: Copy flow scripts into container
shell: |
docker cp /tmp/create_recovery_flow.py authentik-server:/tmp/
docker cp /tmp/create_invitation_flow.py authentik-server:/tmp/
changed_when: false
- name: Create/verify recovery flow - name: Create/verify recovery flow
shell: | shell: |
docker exec -i authentik-server python3 /tmp/create_recovery_flow.py \ docker exec -i authentik-server python3 /tmp/create_recovery_flow.py \
@ -35,12 +41,6 @@
changed_when: "'already exists' not in invitation_flow.stdout" changed_when: "'already exists' not in invitation_flow.stdout"
failed_when: invitation_flow.rc != 0 failed_when: invitation_flow.rc != 0
- name: Copy flow scripts into container
shell: |
docker cp /tmp/create_recovery_flow.py authentik-server:/tmp/
docker cp /tmp/create_invitation_flow.py authentik-server:/tmp/
changed_when: false
- name: Cleanup flow scripts from host - name: Cleanup flow scripts from host
file: file:
path: "{{ item }}" path: "{{ item }}"