Skip to content

Commit 92219a7

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Make custom Gather facts run with default python for kayobe-target-venv" into stable/2025.1
2 parents b7d81f4 + 55e896d commit 92219a7

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

ansible/kayobe-target-venv.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,21 @@
2121
- not ansible_python_interpreter.startswith('/bin')
2222
- not ansible_python_interpreter.startswith('/usr/bin')
2323

24-
- block:
25-
- name: Gather facts
26-
setup:
27-
filter: "{{ kayobe_ansible_setup_filter }}"
28-
gather_subset: "{{ kayobe_ansible_setup_gather_subset }}"
29-
when: not ansible_facts
30-
register: gather_facts
24+
- name: Gather facts
25+
setup:
26+
filter: "{{ kayobe_ansible_setup_filter }}"
27+
gather_subset: "{{ kayobe_ansible_setup_gather_subset }}"
28+
when:
29+
- ansible_facts is undefined or not ansible_facts
30+
- kayobe_virtualenv is defined
31+
register: gather_facts
32+
# Before any facts are gathered, ansible doesn't know about
33+
# python virtualenv.
34+
# Use default python3 to be safe for this task.
35+
vars:
36+
ansible_python_interpreter: /usr/bin/python3
3137

38+
- block:
3239
- name: Ensure the Python venv package is installed on Debian family systems
3340
package:
3441
name: python3-venv

0 commit comments

Comments
 (0)