Remove unnecessary overrides of ansible_python_interpreter

Bifrost cannot operate in virtual environments without system site
packages, so overriding ansible_python_interpreter to system Python
is not necessary.

Document this limitations.

Change-Id: I669c4e248d23f65015533635ed09dcaf60f8f8f2
This commit is contained in:
Dmitry Tantsur 2020-09-01 14:34:20 +02:00
parent e026d0d110
commit 28c08488a5
5 changed files with 9 additions and 14 deletions

View File

@ -26,7 +26,6 @@ COMMON_ENV = {
'VENV': VENV,
}
COMMON_PARAMS = [
'-e', 'ansible_python_interpreter=%s/bin/python3' % VENV,
'-e', 'bifrost_venv_dir=%s' % VENV,
]
BASE = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '..'))

View File

@ -279,6 +279,10 @@ before calling ``env-setup.sh``::
If you're using the ansible playbooks directly (without the helper scripts),
set the ``bifrost_venv_dir`` variables accordingly.
.. note::
Because of Ansible dependencies Bifrost only supports virtual environments
created with ``--system-site-packages``.
Pre-installation settings
=========================

View File

@ -12,16 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
---
# NOTE(hwoarang) The 'apt' module needs python-apt installed in the virtualenv
# but it's not possible to do that. See https://github.com/ansible/ansible/issues/14468
# python-apt only works if it's installed on the local system so we need to switch the
# Ansible python interpreter.
- name: "Update apt cache if Ubuntu/Debian"
apt:
update_cache: yes
when: ansible_os_family == "Debian"
vars:
ansible_python_interpreter: '/usr/bin/python3'
- name: "Load distribution defaults"
include_vars: "{{ item }}"
@ -36,16 +30,10 @@
- "../defaults/required_defaults_{{ ansible_distribution }}_{{ ansible_distribution_version }}.yml"
- "../defaults/dummy-defaults.yml"
# NOTE(hwoarang) The 'apt' module needs python-apt installed in the virtualenv
# but it's not possible to do that. See https://github.com/ansible/ansible/issues/14468
# python-apt only works if it's installed on the local system so we need to switch the
# Ansible python interpreter.
- name: "Install required packages"
package:
name: "{{ required_packages }}"
state: present
vars:
ansible_python_interpreter: '/usr/bin/python3'
- name: ensure installation root folder exists
become: yes

View File

@ -0,0 +1,5 @@
---
issues:
- |
Because of Ansible dependencies Bifrost only works on virtual environments
created with ``--system-site-packages``.

View File

@ -163,7 +163,6 @@ export BIFROST_INVENTORY_SOURCE=${BAREMETAL_DATA_FILE}
${ANSIBLE} -vvvv \
-i inventory/bifrost_inventory.py \
${TEST_PLAYBOOK} \
-e ansible_python_interpreter="${ANSIBLE_PYTHON_INTERP}" \
-e use_cirros=${USE_CIRROS} \
-e testing_user=${TESTING_USER} \
-e test_vm_num_nodes=${TEST_VM_NUM_NODES} \