Fix bifrost_venv_dir default assignment

The lookup('env', ...) will assign a value to the vatiable even if
the env value is undefined, bypassing the default statement in
ansible.
We should use 'or' to fix that.

Change-Id: I113f5180a17b2cec1e26879003b13c415bbd5c0b
This commit is contained in:
Riccardo Pittau 2020-06-29 16:10:41 +02:00
parent 810b5b3001
commit 00ac26e1e4
5 changed files with 5 additions and 5 deletions

View File

@ -21,7 +21,7 @@ reqs_git_folder: /opt/stack/requirements
ipa_builder_git_folder: /opt/stack/ironic-python-agent-builder
# Settings related to installing bifrost in a virtual environment
enable_venv: true
bifrost_venv_dir: "{{ lookup('env', 'VENV') | default('/opt/stack/bifrost') }}"
bifrost_venv_dir: "{{ lookup('env', 'VENV') or '/opt/stack/bifrost' }}"
bifrost_venv_env:
VIRTUAL_ENV: "{{ bifrost_venv_dir }}"
PATH: "{{ bifrost_venv_dir }}/bin:{{ ansible_env.PATH }}" # include regular path via lookup env

View File

@ -36,7 +36,7 @@ test_vm_machine: "pc-1.0"
test_vm_libvirt_uri: "{{ lookup('env', 'LIBVIRT_CONNECT_URI') | default('qemu:///system', true) }}"
# Settings related to installing bifrost in a virtual environment
enable_venv: true
bifrost_venv_dir: "{{ lookup('env', 'VENV') | default('/opt/stack/bifrost') }}"
bifrost_venv_dir: "{{ lookup('env', 'VENV') or '/opt/stack/bifrost' }}"
bifrost_venv_env:
VIRTUAL_ENV: "{{ bifrost_venv_dir }}"
PATH: "{{ bifrost_venv_dir }}/bin:{{ ansible_env.PATH }}" # include regular path via lookup env

View File

@ -241,7 +241,7 @@ download_ipxe: false
# Settings related to installing bifrost in a virtual environment
enable_venv: true
bifrost_venv_dir: "{{ lookup('env', 'VENV') | default('/opt/stack/bifrost') }}"
bifrost_venv_dir: "{{ lookup('env', 'VENV') or '/opt/stack/bifrost' }}"
bifrost_venv_env:
VIRTUAL_ENV: "{{ bifrost_venv_dir }}"
PATH: "{{ bifrost_venv_dir }}/bin:{{ ansible_env.PATH }}" # include regular path via lookup env

View File

@ -36,7 +36,7 @@ http_boot_folder: /httpboot
# Settings related to installing bifrost in a virtual environment
enable_venv: true
bifrost_venv_dir: "{{ lookup('env', 'VENV') | default('/opt/stack/bifrost') }}"
bifrost_venv_dir: "{{ lookup('env', 'VENV') or '/opt/stack/bifrost' }}"
bifrost_venv_env:
VIRTUAL_ENV: "{{ bifrost_venv_dir }}"
PATH: "{{ bifrost_venv_dir }}/bin:{{ ansible_env.PATH }}" # include regular path via lookup env

View File

@ -1,6 +1,6 @@
---
# Global options
bifrost_venv_dir: "{{ lookup('env', 'VENV') | default('/opt/stack/bifrost') }}"
bifrost_venv_dir: "{{ lookup('env', 'VENV') or '/opt/stack/bifrost' }}"
bifrost_venv_env:
VIRTUAL_ENV: "{{ bifrost_venv_dir }}"
PATH: "{{ bifrost_venv_dir }}/bin:{{ ansible_env.PATH }}" # include regular path via lookup env