Skip to content
This repository was archived by the owner on May 13, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions data/ignition/files/usr/local/bin/start-cluster-installation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,12 @@ done

echo "All ${total_required_nodes} hosts are ready."

api_vip=$(curl -s -S "${BASE_URL}/clusters" | jq -r .[].api_vip)
if [ "${api_vip}" == null ]; then
echo "Setting api vip"
curl -s -S -X PATCH "${BASE_URL}/clusters/${cluster_id}" -H "Content-Type: application/json" -d '{"api_vip": "{{.APIVIP}}"}'
if [[ "$total_required_nodes" > "1" ]]; then
api_vip=$(curl -s -S "${BASE_URL}/clusters" | jq -r .[].api_vip)
if [ "${api_vip}" == null ]; then
echo "Setting api vip"
curl -s -S -X PATCH "${BASE_URL}/clusters/${cluster_id}" -H "Content-Type: application/json" -d '{"api_vip": "{{.APIVIP}}"}'
fi
fi

while [[ "${cluster_status}" != "ready" ]]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
[Unit]
Description=Service that starts cluster installation
Wants=network-online.target create-cluster-and-infra-env.service
After=network-online.target create-cluster-and-infra-env.service
Wants=network-online.target assisted-service.service
PartOf=assisted-service-pod.service
After=network-online.target assisted-service.service
ConditionPathExists=/etc/assisted-service/node0

[Service]
ExecStart=/usr/local/bin/start-cluster-installation.sh

KillMode=none
Type=oneshot
RemainAfterExit=true


[Install]
Expand Down