Skip to content

Commit 7e5498d

Browse files
raukadahsdatko
authored andcommitted
Fix undefined ansible_user_dir var in inject success flag task
#3036 Separate deployment from testing. As it also moves `inject success flag` task to post-deployment playbook. The play where `inject success flag` task runs, gather_facts is set to false. ansible_user_dir is coming undefined. In order to fix that, we are adding a task to collect ansible_user_dir fact. This will make sure ansible_user_dir exists. Note: This code is generated by Gemini 2.5 Flash with following prompt ``` what gather_facts I can run to collect ansible_user_dir ``` Generated-By: Gemini 2.5 Flash Signed-off-by: Chandan Kumar (raukadah) <raukadah@gmail.com>
1 parent c605465 commit 7e5498d

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

post-deployment.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@
5454
ansible.builtin.import_role:
5555
name: run_hook
5656

57+
- name: Gather minimal facts for ansible_user_dir
58+
ansible.builtin.setup:
59+
gather_subset:
60+
- min
61+
filter: "ansible_user_dir"
62+
5763
- name: Inject success flag
5864
ansible.builtin.file:
5965
path: "{{ ansible_user_dir }}/cifmw-success"

0 commit comments

Comments
 (0)