From 5b38c4b5b4006ad9d2c590061f8de10bc379b5ea Mon Sep 17 00:00:00 2001 From: Pieter Date: Tue, 13 Jan 2026 10:55:14 +0100 Subject: [PATCH] fix: Copy flow scripts into container before executing them MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- ansible/roles/authentik/tasks/flows.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ansible/roles/authentik/tasks/flows.yml b/ansible/roles/authentik/tasks/flows.yml index 1bd0fb3..47ca18c 100644 --- a/ansible/roles/authentik/tasks/flows.yml +++ b/ansible/roles/authentik/tasks/flows.yml @@ -17,6 +17,12 @@ dest: /tmp/create_invitation_flow.py 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 shell: | docker exec -i authentik-server python3 /tmp/create_recovery_flow.py \ @@ -35,12 +41,6 @@ changed_when: "'already exists' not in invitation_flow.stdout" 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 file: path: "{{ item }}"