From 086e295cda21924fb1170fc113c31f297196f329 Mon Sep 17 00:00:00 2001 From: Yussuf Shaikh Date: Wed, 8 Oct 2025 21:36:52 +0530 Subject: [PATCH] Option to ignore deleting the bootstrap node Signed-off-by: Yussuf Shaikh --- README.md | 21 +++++++++++---------- openshift-install-powervs | 27 ++++++++++++++++----------- 2 files changed, 27 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 1ce1eab..b22beb0 100644 --- a/README.md +++ b/README.md @@ -104,16 +104,17 @@ Available commands: help Display this information Where : - -var Terraform variable to be passed to the create/destroy command - -var-file Terraform variable file name in current directory. (By default using var.tfvars) - -flavor Cluster compute template to use eg: small, medium, large - -force-destroy Not ask for confirmation during destroy command - -ignore-os-checks Ignore operating system related checks - -ignore-warnings Warning messages will not be displayed. Should be specified first, before any other args. - -verbose Enable verbose for terraform console messages - -all-images List all the images available during variables prompt - -trace Enable tracing of all executed commands - -version, -v Display the script version + -var Terraform variable to be passed to the create/destroy command + -var-file Terraform variable file name in current directory. (By default using var.tfvars) + -flavor Cluster compute template to use eg: small, medium, large + -force-destroy Not ask for confirmation during destroy command + -ignore-os-checks Ignore operating system related checks + -ignore-warnings Warning messages will not be displayed. Should be specified first, before any other args. + -verbose Enable verbose for terraform console messages + -all-images List all the images available during variables prompt + -trace Enable tracing of all executed commands + -version, -v Display the script version + -skip-bootstrap-delete Do not delete bootstrap node after the installation is complete Environment Variables: IBMCLOUD_API_KEY IBM Cloud API key diff --git a/openshift-install-powervs b/openshift-install-powervs index f33c89b..abcf004 100755 --- a/openshift-install-powervs +++ b/openshift-install-powervs @@ -36,16 +36,17 @@ Available commands: help Display this information Where : - -var Terraform variable to be passed to the create/destroy command - -var-file Terraform variable file name in current directory. (By default using var.tfvars) - -flavor Cluster compute template to use eg: small, medium, large - -force-destroy Not ask for confirmation during destroy command - -ignore-os-checks Ignore operating system related checks - -ignore-warnings Warning messages will not be displayed. Should be specified first, before any other args. - -verbose Enable verbose for terraform console messages - -all-images List all the images available during variables prompt - -trace Enable tracing of all executed commands - -version, -v Display the script version + -var Terraform variable to be passed to the create/destroy command + -var-file Terraform variable file name in current directory. (By default using var.tfvars) + -flavor Cluster compute template to use eg: small, medium, large + -force-destroy Not ask for confirmation during destroy command + -ignore-os-checks Ignore operating system related checks + -ignore-warnings Warning messages will not be displayed. Should be specified first, before any other args. + -verbose Enable verbose for terraform console messages + -all-images List all the images available during variables prompt + -trace Enable tracing of all executed commands + -version, -v Display the script version + -skip-bootstrap-delete Do not delete bootstrap node after the installation is complete Environment Variables: IBMCLOUD_API_KEY IBM Cloud API key @@ -81,6 +82,7 @@ IGNORE_OS=0 IGNORE_WARN=0 DISPLAY_ALL_IMAGES=0 IS_HA=0 +SKIP_DELETE_BOOTSTRAP=0 NO_OF_RETRY=${NO_OF_RETRY:-"5"} SLEEP_TIME=10 @@ -585,7 +587,7 @@ function retry_terraform { else if [[ $action == "destroy" ]];then rm -f "$BOOTSTRAP_DELETE_VARFILE" - elif [[ $action == "apply" ]] && [[ ! -f "$BOOTSTRAP_DELETE_VARFILE" ]]; then + elif [[ $action == "apply" ]] && [[ ! -f "$BOOTSTRAP_DELETE_VARFILE" ]] && [[ $SKIP_DELETE_BOOTSTRAP -eq 0 ]]; then log "Deleting the bootstrap node... please wait" # Create the bootstrap delete var file echo "bootstrap = {count = 0, memory = \"32\", processors = \"0.5\"}" > "$BOOTSTRAP_DELETE_VARFILE" @@ -1628,6 +1630,9 @@ function main { "-version"|"-v") display_version ;; + "-skip-bootstrap-delete") + SKIP_DELETE_BOOTSTRAP=1 + ;; "-verbose") warn "Enabling verbose for terraform console" TF_TRACE=1