auto-detect interpreter
setting ANSIBLE_PYTHON_INTERPRETER to auto will use the value from the ansible/config/base.yml debian gets a /usr/bin/python3 for now and need to revisit once we have ansible 2.10. Change-Id: I503c1b71c0d01eea668500c0125c752c0584a7ef Co-Authored-By: Jonathan Rosser <jonathan.rosser@rd.bbc.co.uk>
This commit is contained in:
parent
db14a6ffd6
commit
0a244ca090
@ -136,7 +136,6 @@
|
||||
- item['scm'] == "git" or item['scm'] is undefined
|
||||
|
||||
vars:
|
||||
ansible_python_interpreter: "/usr/bin/python3"
|
||||
homedir: "{{ lookup('env', 'TESTING_HOME') }}"
|
||||
role_file: "{{ lookup('env', 'ANSIBLE_ROLE_REQUIREMENTS_PATH') }}"
|
||||
osa_roles: "{{ lookup('file', role_file) | from_yaml }}"
|
||||
|
@ -29,6 +29,15 @@
|
||||
set -e
|
||||
|
||||
## Vars ----------------------------------------------------------------------
|
||||
# Source distribution information
|
||||
source /etc/os-release || source /usr/lib/os-release
|
||||
|
||||
#TODO: cleanup on ansible 2.10 if debian is in config/base.yml
|
||||
if [ "${ID}" == "debian" ] && [ "${VERSION_ID}" == "10" ]; then
|
||||
ANSIBLE_PYTHON_INTERPRETER="/usr/bin/python3"
|
||||
fi
|
||||
|
||||
export ANSIBLE_PYTHON_INTERPRETER=${ANSIBLE_PYTHON_INTERPRETER:-auto}
|
||||
|
||||
export TESTING_HOME=${TESTING_HOME:-$HOME}
|
||||
export WORKING_DIR=${WORKING_DIR:-$(pwd)}
|
||||
@ -48,6 +57,7 @@ echo "ANSIBLE_PARAMETERS: ${ANSIBLE_PARAMETERS}"
|
||||
echo "TEST_PLAYBOOK: ${TEST_PLAYBOOK}"
|
||||
echo "TEST_CHECK_MODE: ${TEST_CHECK_MODE}"
|
||||
echo "TEST_IDEMPOTENCE: ${TEST_IDEMPOTENCE}"
|
||||
echo "ANSIBLE_PYTHON_INTERPRETER: ${ANSIBLE_PYTHON_INTERPRETER}"
|
||||
|
||||
## Functions -----------------------------------------------------------------
|
||||
|
||||
|
@ -29,8 +29,6 @@
|
||||
become: no
|
||||
gather_facts: false
|
||||
any_errors_fatal: true
|
||||
vars:
|
||||
ansible_python_interpreter: "{{ ansible_playbook_python }}"
|
||||
vars_files:
|
||||
- test-vars.yml
|
||||
tasks:
|
||||
|
@ -21,4 +21,3 @@ bridges:
|
||||
ip_addr: "10.1.2.1"
|
||||
veth_peer: "veth-test"
|
||||
|
||||
ansible_python_interpreter: "/usr/bin/python"
|
||||
|
Loading…
x
Reference in New Issue
Block a user