Skip to content

Commit 4befdca

Browse files
authored
agent: enable assisted ui (#1431)
1 parent 71dd29e commit 4befdca

File tree

1 file changed

+26
-4
lines changed

1 file changed

+26
-4
lines changed

agent/05_agent_create_cluster.sh

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,16 @@ function attach_agent_iso() {
3535
done
3636
}
3737

38+
function get_node0_ip() {
39+
node0_name=$(printf ${MASTER_HOSTNAME_FORMAT} 0)
40+
node0_ip=$(sudo virsh net-dumpxml ostestbm | xmllint --xpath "string(//dns[*]/host/hostname[. = '${node0_name}']/../@ip)" -)
41+
echo "${node0_ip}"
42+
}
43+
3844
function force_mirror_disconnect() {
3945

4046
# Set a bogus entry in /etc/hosts on all masters to force the local mirror to be used
41-
node0_name=$(printf ${MASTER_HOSTNAME_FORMAT} 0)
42-
node0_ip=$(sudo virsh net-dumpxml ostestbm | xmllint --xpath "string(//dns[*]/host/hostname[. = '${node0_name}']/../@ip)" -)
47+
node0_ip=$(get_node0_ip)
4348
ssh_opts=(-o 'StrictHostKeyChecking=no' -q core@${node0_ip})
4449

4550
for (( n=0; n<${NUM_MASTERS}; n++ ))
@@ -61,10 +66,22 @@ function force_mirror_disconnect() {
6166

6267
}
6368

69+
function enable_assisted_service_ui() {
70+
node0_ip=$(get_node0_ip)
71+
ssh_opts=(-o 'StrictHostKeyChecking=no' -o 'UserKnownHostsFile=/dev/null' -q core@${node0_ip})
72+
73+
until ssh "${ssh_opts[@]}" "[[ -f /run/assisted-service-pod.pod-id ]]"
74+
do
75+
echo "Waiting for node0"
76+
sleep 5s;
77+
done
78+
79+
ssh "${ssh_opts[@]}" "sudo /usr/bin/podman run -d --name=assisted-ui --pod-id-file=/run/assisted-service-pod.pod-id quay.io/edge-infrastructure/assisted-installer-ui:latest"
80+
}
81+
6482
function wait_for_cluster_ready() {
6583

66-
node0_name=$(printf ${MASTER_HOSTNAME_FORMAT} 0)
67-
node0_ip=$(sudo virsh net-dumpxml ostestbm | xmllint --xpath "string(//dns[*]/host/hostname[. = '${node0_name}']/../@ip)" -)
84+
node0_ip=$(get_node0_ip)
6885
ssh_opts=(-o 'StrictHostKeyChecking=no' -o 'UserKnownHostsFile=/dev/null' -q core@${node0_ip})
6986

7087
local openshift_install="$(realpath "${OCP_DIR}/openshift-install")"
@@ -89,6 +106,11 @@ if [ ! -z "${MIRROR_IMAGES}" ]; then
89106
force_mirror_disconnect
90107
fi
91108

109+
if [ ! -z "${AGENT_ENABLE_GUI:-}" ]; then
110+
enable_assisted_service_ui
111+
fi
112+
113+
92114
wait_for_cluster_ready
93115
# Temporary fix for the CI. To be removed once we'll
94116
# be able to generate the cluster credentials

0 commit comments

Comments
 (0)