@@ -23,6 +23,8 @@ if [ -z "${METAL3_DEV_ENV}" ]; then
23
23
popd
24
24
fi
25
25
26
+ ANSIBLE_VENV=" ${WORKING_DIR} /venv"
27
+
26
28
# This must be aligned with the metal3-dev-env pinned version above, see
27
29
# https://github.com/metal3-io/metal3-dev-env/blob/master/lib/common.sh
28
30
export ANSIBLE_VERSION=${ANSIBLE_VERSION:- " 5.9.0" }
@@ -110,16 +112,18 @@ elif [[ $GOARCH == "x86_64" ]]; then
110
112
GOARCH=" amd64"
111
113
fi
112
114
115
+ sudo python -m venv --system-site-packages " ${ANSIBLE_VENV} "
116
+
113
117
# Also need the 3.9 version of netaddr for ansible.netcommon
114
118
# and lxml for the pyxpath script
115
- sudo python -m pip install netaddr lxml
119
+ " ${ANSIBLE_VENV} /bin/ pip" install netaddr lxml
116
120
117
- sudo python -m pip install ansible==" ${ANSIBLE_VERSION} "
121
+ " ${ANSIBLE_VENV} /bin/ pip" install ansible==" ${ANSIBLE_VERSION} "
118
122
119
123
pushd ${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" \
123
127
-e " working_dir=$WORKING_DIR " \
124
128
-e " virthost=$HOSTNAME " \
125
129
-e " go_version=$GO_VERSION " \
0 commit comments