Skip to content

Commit

Permalink
utils/run-tests.sh: Allow setting Python interpreter
Browse files Browse the repository at this point in the history
This patch allow overriding Ansible's Python interpreter by setting the
enviroment variable PYTHO_INTERPRETER. This can be used to test with
different python versions, or to workaround issues like

    https://access.redhat.com/solutions/6726561
  • Loading branch information
rjeffman committed Feb 10, 2024
1 parent 4a7b409 commit 1e990c7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions utils/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,10 @@ make_inventory() {
local scenario=$1 engine=${2:-podman}
inventory="${test_env}/inventory"
log info "Inventory file: ${inventory}"
[ -n "${PYTHON_INTERPRETER}" ] && ADD_PYTHON_INTERPRETER="ansible_python_interpreter=${PYTHON_INTERPRETER}"
cat << EOF > "${inventory}"
[ipaserver]
${scenario} ansible_connection=${engine}
${scenario} ansible_connection=${engine} ${ADD_PYTHON_INTERPRETER}
[ipaserver:vars]
ipaserver_domain = test.local
ipaserver_realm = TEST.LOCAL
Expand Down Expand Up @@ -288,7 +289,7 @@ then
log warn "Installed collections will not be removed after execution."
log none "Installing: Ansible Collection ${ANSIBLE_COLLECTIONS}"
# shellcheck disable=SC2086
quiet ansible-galaxy collection install ${ANSIBLE_COLLECTIONS} || die "Failed to install Ansible collections."
ansible-galaxy collection install ${ANSIBLE_COLLECTIONS} || die "Failed to install Ansible collections."
fi

# Ansible configuration
Expand Down

0 comments on commit 1e990c7

Please sign in to comment.