From 23671c0d0864b49c2fbf63642e2142a370ff68da Mon Sep 17 00:00:00 2001 From: Pawan Pinjarkar Date: Tue, 10 May 2022 23:28:24 -0400 Subject: [PATCH 1/3] AGENT-193: Do not set api_vip for SNO cluster --- .../files/usr/local/bin/start-cluster-installation.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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" ]] From f88cd69ea5551313ddcb876a8b6d747f873a8acd Mon Sep 17 00:00:00 2001 From: Pawan Pinjarkar Date: Wed, 11 May 2022 15:56:21 -0400 Subject: [PATCH 2/3] debug start cluster installation --- data/ignition/systemd/units/start-cluster-installation.service | 2 ++ 1 file changed, 2 insertions(+) diff --git a/data/ignition/systemd/units/start-cluster-installation.service b/data/ignition/systemd/units/start-cluster-installation.service index f34fbed..2f1869d 100644 --- a/data/ignition/systemd/units/start-cluster-installation.service +++ b/data/ignition/systemd/units/start-cluster-installation.service @@ -1,6 +1,7 @@ [Unit] Description=Service that starts cluster installation Wants=network-online.target create-cluster-and-infra-env.service +PartOf=assisted-service-pod.service After=network-online.target create-cluster-and-infra-env.service ConditionPathExists=/etc/assisted-service/node0 @@ -9,6 +10,7 @@ ExecStart=/usr/local/bin/start-cluster-installation.sh KillMode=none Type=oneshot +RemainAfterExit=true [Install] From 6982cab7e4d15626a68a198716f14a7da4e1016a Mon Sep 17 00:00:00 2001 From: Pawan Pinjarkar Date: Wed, 11 May 2022 16:10:08 -0400 Subject: [PATCH 3/3] Debug --- .../ignition/systemd/units/start-cluster-installation.service | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/ignition/systemd/units/start-cluster-installation.service b/data/ignition/systemd/units/start-cluster-installation.service index 2f1869d..eb23f1e 100644 --- a/data/ignition/systemd/units/start-cluster-installation.service +++ b/data/ignition/systemd/units/start-cluster-installation.service @@ -1,8 +1,8 @@ [Unit] Description=Service that starts cluster installation -Wants=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 create-cluster-and-infra-env.service +After=network-online.target assisted-service.service ConditionPathExists=/etc/assisted-service/node0 [Service]