File tree 8 files changed +16
-12
lines changed
8 files changed +16
-12
lines changed Original file line number Diff line number Diff line change @@ -110,16 +110,18 @@ elif [[ $GOARCH == "x86_64" ]]; then
110
110
GOARCH=" amd64"
111
111
fi
112
112
113
+ sudo python -m venv --system-site-packages " ${ANSIBLE_VENV} "
114
+
113
115
# Also need the 3.9 version of netaddr for ansible.netcommon
114
116
# and lxml for the pyxpath script
115
- sudo python -m pip install netaddr lxml
117
+ " ${ANSIBLE_VENV} /bin/ pip" install netaddr lxml
116
118
117
- sudo python -m pip install ansible==" ${ANSIBLE_VERSION} "
119
+ " ${ANSIBLE_VENV} /bin/ pip" install ansible==" ${ANSIBLE_VERSION} "
118
120
119
121
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 \
122
+ " ${ANSIBLE} -galaxy" install -r vm-setup/requirements.yml
123
+ " ${ANSIBLE} -galaxy" collection install --upgrade ansible.netcommon ansible.posix ansible.utils community.general
124
+ ANSIBLE_FORCE_COLOR=true " ${ANSIBLE} -playbook" \
123
125
-e " working_dir=$WORKING_DIR " \
124
126
-e " virthost=$HOSTNAME " \
125
127
-e " go_version=$GO_VERSION " \
Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ if [[ $(uname -m) == "aarch64" ]]; then
127
127
echo " libvirt_cdrombus: scsi" >> vm_setup_vars.yml
128
128
fi
129
129
130
- ansible -playbook \
130
+ " ${ANSIBLE} -playbook" \
131
131
-e @vm_setup_vars.yml \
132
132
-e " ironic_prefix=${CLUSTER_NAME} _" \
133
133
-e " cluster_name=${CLUSTER_NAME} " \
@@ -327,7 +327,7 @@ if [[ "$(ipversion $PROVISIONING_HOST_IP)" == "6" ]]; then
327
327
IPTABLES=ip6tables
328
328
fi
329
329
330
- ANSIBLE_FORCE_COLOR=true ansible -playbook \
330
+ ANSIBLE_FORCE_COLOR=true " ${ANSIBLE} -playbook" \
331
331
-e " {use_firewalld: True}" \
332
332
-e " provisioning_interface=$PROVISIONING_NETWORK_NAME " \
333
333
-e " baremetal_interface=$BAREMETAL_NETWORK_NAME " \
Original file line number Diff line number Diff line change @@ -263,7 +263,7 @@ function generate_cluster_manifests() {
263
263
set -x
264
264
265
265
# Create manifests
266
- ansible -playbook -vvv \
266
+ " ${ANSIBLE} -playbook" -vvv \
267
267
-e install_path=${SCRIPTDIR} /${INSTALL_CONFIG_PATH} \
268
268
" ${SCRIPTDIR} /agent/create-manifests-playbook.yaml"
269
269
}
Original file line number Diff line number Diff line change @@ -94,6 +94,8 @@ export PROVISIONING_HOST_USER=${PROVISIONING_HOST_USER:-$USER}
94
94
# The dev-scripts working directory
95
95
export WORKING_DIR=${WORKING_DIR:- " /opt/dev-scripts" }
96
96
OCP_DIR=${OCP_DIR:- ocp/ ${CLUSTER_NAME} }
97
+ ANSIBLE_VENV=${ANSIBLE_VENV:- " ${WORKING_DIR} /venv" }
98
+ ANSIBLE=" ${ANSIBLE_VENV} /bin/ansible"
97
99
98
100
# The DNS name for the registry that this cluster should use.
99
101
export LOCAL_REGISTRY_DNS_NAME=${LOCAL_REGISTRY_DNS_NAME:- " virthost.${CLUSTER_NAME} .${BASE_DOMAIN} " }
Original file line number Diff line number Diff line change 15
15
16
16
export ANSIBLE_FORCE_COLOR=true
17
17
18
- ansible -playbook \
18
+ " ${ANSIBLE} -playbook" \
19
19
-e @vm_setup_vars.yml \
20
20
-e " ironic_prefix=${CLUSTER_NAME} _" \
21
21
-e " cluster_name=${CLUSTER_NAME} " \
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ function nth_ip() {
6
6
network=$1
7
7
idx=$2
8
8
9
- python -c " from ansible_collections.ansible.utils.plugins.filter import nthhost; print(nthhost.nthhost('" $network " ', $idx ))"
9
+ " ${ANSIBLE_VENV} /bin/ python" -c " from ansible_collections.ansible.utils.plugins.filter import nthhost; print(nthhost.nthhost('" $network " ', $idx ))"
10
10
}
11
11
12
12
function ipversion(){
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ function playbook() {
68
68
VIRTBMC_ACTION=" ignore"
69
69
fi
70
70
71
- ansible -playbook \
71
+ " ${ANSIBLE} -playbook" \
72
72
-e @vm_setup_vars.yml \
73
73
-e " ironic_prefix=${REMOTE_CLUSTER_NAME} _" \
74
74
-e " cluster_name=${REMOTE_CLUSTER_NAME} " \
Original file line number Diff line number Diff line change @@ -787,7 +787,7 @@ function write_pull_secret() {
787
787
788
788
function switch_to_internal_dns() {
789
789
sudo mkdir -p /etc/NetworkManager/conf.d/
790
- ansible localhost -b -m ini_file -a " path=/etc/NetworkManager/conf.d/dnsmasq.conf section=main option=dns value=dnsmasq"
790
+ " ${ANSIBLE} " localhost -b -m ini_file -a " path=/etc/NetworkManager/conf.d/dnsmasq.conf section=main option=dns value=dnsmasq"
791
791
if [ " $ADDN_DNS " ] ; then
792
792
echo " server=$ADDN_DNS " | sudo tee /etc/NetworkManager/dnsmasq.d/upstream.conf
793
793
fi
You can’t perform that action at this time.
0 commit comments