diff --git a/data/ignition/files/usr/local/bin/start-cluster-installation.sh b/data/ignition/files/usr/local/bin/start-cluster-installation.sh index dc31d08..67585ad 100644 --- a/data/ignition/files/usr/local/bin/start-cluster-installation.sh +++ b/data/ignition/files/usr/local/bin/start-cluster-installation.sh @@ -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" ]] diff --git a/data/ignition/systemd/units/start-cluster-installation.service b/data/ignition/systemd/units/start-cluster-installation.service index f34fbed..eb23f1e 100644 --- a/data/ignition/systemd/units/start-cluster-installation.service +++ b/data/ignition/systemd/units/start-cluster-installation.service @@ -1,7 +1,8 @@ [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] @@ -9,6 +10,7 @@ ExecStart=/usr/local/bin/start-cluster-installation.sh KillMode=none Type=oneshot +RemainAfterExit=true [Install]