@@ -23,6 +23,8 @@ if [ -z "${METAL3_DEV_ENV}" ]; then
2323 popd
2424fi
2525
26+ ANSIBLE_VENV=" ${WORKING_DIR} /venv"
27+
2628# This must be aligned with the metal3-dev-env pinned version above, see
2729# https://github.com/metal3-io/metal3-dev-env/blob/master/lib/common.sh
2830export ANSIBLE_VERSION=${ANSIBLE_VERSION:- " 5.9.0" }
@@ -110,16 +112,18 @@ elif [[ $GOARCH == "x86_64" ]]; then
110112 GOARCH=" amd64"
111113fi
112114
115+ sudo python -m venv --system-site-packages " ${ANSIBLE_VENV} "
116+
113117# Also need the 3.9 version of netaddr for ansible.netcommon
114118# and lxml for the pyxpath script
115- sudo python -m pip install netaddr lxml
119+ " ${ANSIBLE_VENV} /bin/ pip" install netaddr lxml
116120
117- sudo python -m pip install ansible==" ${ANSIBLE_VERSION} "
121+ " ${ANSIBLE_VENV} /bin/ pip" install ansible==" ${ANSIBLE_VERSION} "
118122
119123pushd ${METAL3_DEV_ENV_PATH}
120- ansible-galaxy install -r vm-setup/requirements.yml
121- ansible-galaxy collection install --upgrade ansible.netcommon ansible.posix ansible.utils community.general
122- ANSIBLE_FORCE_COLOR=true ansible-playbook \
124+ " ${ANSIBLE_VENV} /bin/ ansible-galaxy" install -r vm-setup/requirements.yml
125+ " ${ANSIBLE_VENV} /bin/ ansible-galaxy" install --upgrade ansible.netcommon ansible.posix ansible.utils community.general
126+ ANSIBLE_FORCE_COLOR=true " ${ANSIBLE_VENV} /bin/ ansible-playbook" \
123127 -e " working_dir=$WORKING_DIR " \
124128 -e " virthost=$HOSTNAME " \
125129 -e " go_version=$GO_VERSION " \
0 commit comments