
This patch ensures that the system Python interpreter is always used during the `bootstrap-servers` phase by setting `ansible_python_interpreter=auto_silent` via `extra_vars`, while the `octavia-certificates` command now explicitly uses the same Python interpreter that was used to invoke the `kolla-ansible` CLI, ensuring compatibility with the local environment. Summary: - The `ansible_python_interpreter` is now dynamically defined in `group_vars/all.yml`, falling back to the system interpreter if no virtualenv is configured. - CLI commands now detect and respect user-specified `ansible_python_interpreter` values via `-e`, and avoid overriding them. - The `bootstrap-servers` command always uses the system Python interpreter by setting `ansible_python_interpreter=auto_silent`, ensuring a clean environment for virtualenv creation. - The `octavia-certificates` command uses the Python interpreter that invoked the `kolla-ansible` CLI, ensuring compatibility with locally installed packages (e.g. cryptography). This improves interpreter handling across commands, especially in environments with custom Python setups or virtual environments. Depends-On: https://review.opendev.org/c/openstack/ansible-collection-kolla/+/949767 Change-Id: I7dc6cf8eda3b1fd48d2000f18b4670a4ef4ce1b4
16 lines
417 B
YAML
16 lines
417 B
YAML
---
|
|
ansible_python_interpreter: >-
|
|
{{
|
|
virtualenv ~ '/bin/python'
|
|
if virtualenv is defined
|
|
and virtualenv is not none
|
|
and virtualenv | length > 0
|
|
else (
|
|
ansible_facts.python.executable
|
|
if ansible_facts.python.executable is defined
|
|
and ansible_facts.python.executable is not none
|
|
and ansible_facts.python.executable | length > 0
|
|
else 'auto_silent'
|
|
)
|
|
}}
|