From 3c076ed6459faac8428e558bbb1c38b26257ed2d Mon Sep 17 00:00:00 2001 From: Jonathan Rosser Date: Thu, 5 Sep 2019 18:00:07 +0100 Subject: [PATCH] Use python3 source installs of OpenStack services where possible Detect CentOS and deploy from source as python2, otherwise default to python3 on all other distros. Change-Id: Ic68dc0923a26ece68b1971648c62bb2e0c05c50b --- inventory/group_vars/all/all.yml | 6 ++++++ playbooks/utility-install.yml | 1 + 2 files changed, 7 insertions(+) diff --git a/inventory/group_vars/all/all.yml b/inventory/group_vars/all/all.yml index b10b203fdf..fe1a2b0c23 100644 --- a/inventory/group_vars/all/all.yml +++ b/inventory/group_vars/all/all.yml @@ -19,6 +19,12 @@ openstack_release: "{{ lookup('env', 'OSA_VERSION') | default('undefined', true) ## OpenStack Configuration directory openstack_config_dir: "{{ lookup('env', 'OSA_CONFIG_DIR') | default('/etc/openstack_deploy') }}" +## OpenStack service python version +openstack_venv_python_executable: "{{ (ansible_distribution == 'CentOS') | ternary('python2', 'python3') }}" + +#uwsgi venv deploys the same python version as OpenStack service venv +uwsgi_python_executable: "{{ openstack_venv_python_executable }}" + ## Verbosity Options debug: False diff --git a/playbooks/utility-install.yml b/playbooks/utility-install.yml index 1400eeb4c7..9c1197e9d1 100644 --- a/playbooks/utility-install.yml +++ b/playbooks/utility-install.yml @@ -120,6 +120,7 @@ include_role: name: "python_venv_build" vars: + venv_python_executable: "{{ utility_venv_python_executable | default(openstack_venv_python_executable) }}" venv_install_destination_path: "{{ utility_venv_bin | dirname }}" venv_pip_install_args: "{{ pip_install_options | default('') }}" venv_build_constraints: