Merge "scripts: Use ansible_python_interpreter on localhost"
This commit is contained in:
commit
2074cc0db9
|
@ -42,9 +42,15 @@
|
|||
when: (ansible_os_family | search("SUSE LINUX")) or
|
||||
(ansible_os_family | search("openSUSE Leap"))
|
||||
|
||||
# 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
|
||||
vars:
|
||||
ansible_python_interpreter: '/usr/bin/python'
|
||||
when: ansible_os_family == "Debian"
|
||||
|
||||
- name: "Load distribution defaults"
|
||||
|
@ -72,9 +78,15 @@
|
|||
ansible_pkg_mgr: "dnf"
|
||||
when: ansible_distribution == 'Fedora' and test_dnf.stat.exists|bool
|
||||
|
||||
# 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"
|
||||
action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
|
||||
with_items: "{{ required_packages }}"
|
||||
vars:
|
||||
ansible_python_interpreter: '/usr/bin/python'
|
||||
|
||||
- include: prepare_libvirt.yml
|
||||
|
||||
|
|
|
@ -105,9 +105,11 @@ if [ ${USE_VENV} = "true" ]; then
|
|||
set -u
|
||||
ANSIBLE=${VENV}/bin/ansible-playbook
|
||||
ENABLE_VENV="true"
|
||||
ANSIBLE_PYTHON_INTERP=${VENV}/bin/python
|
||||
else
|
||||
$SCRIPT_HOME/env-setup.sh
|
||||
ANSIBLE=${HOME}/.local/bin/ansible-playbook
|
||||
ANSIBLE_PYTHON_INTERP=$(which python)
|
||||
fi
|
||||
|
||||
# Adjust options for DHCP, VM, or Keystone tests
|
||||
|
@ -157,6 +159,7 @@ done
|
|||
${ANSIBLE} -vvvv \
|
||||
-i inventory/localhost \
|
||||
test-bifrost-create-vm.yaml \
|
||||
-e ansible_python_interpreter="${ANSIBLE_PYTHON_INTERP}" \
|
||||
-e test_vm_num_nodes=${TEST_VM_NUM_NODES} \
|
||||
-e test_vm_memory_size=${VM_MEMORY_SIZE} \
|
||||
-e test_vm_domain_type=${VM_DOMAIN_TYPE} \
|
||||
|
|
Loading…
Reference in New Issue