diff --git a/ansible/post/files/destroy-workers.sh b/ansible/post/files/destroy-workers.sh index 2e6fcc8..85853a7 100644 --- a/ansible/post/files/destroy-workers.sh +++ b/ansible/post/files/destroy-workers.sh @@ -15,8 +15,9 @@ PROXY_SERVER="${1}" NAME_PREFIX="${2}" # Get COUNT for all power workers with name having NAME_PREFIX +# Nodes that are NotReady are included in the count intentionally COUNT=$(oc get nodes -l kubernetes.io/arch=ppc64le | grep "${NAME_PREFIX}" | grep -c Ready) -echo "Available COUNT for Power worker/s with Prefix '${NAME_PREFIX}' is $COUNT" +echo "Available COUNT for Power worker/s with Prefix '${NAME_PREFIX}' is ${COUNT}" IDX=0 while [ "$IDX" -lt "$COUNT" ] diff --git a/modules/6_post/post.tf b/modules/6_post/post.tf index 26cc416..97a3ae7 100644 --- a/modules/6_post/post.tf +++ b/modules/6_post/post.tf @@ -40,8 +40,8 @@ resource "null_resource" "post_setup" { resource "null_resource" "remove_workers" { depends_on = [null_resource.post_setup] + # var.worker["count"] is intentionally not included as a trigger triggers = { - # count = var.worker["count"] name_prefix = "${var.name_prefix}" vpc_support_server_ip = "${var.nfs_server}" private_key = sensitive(file(var.private_key_file)) @@ -80,6 +80,7 @@ EOF resource "null_resource" "post_ansible" { depends_on = [null_resource.remove_workers, null_resource.post_setup] + # Trigger for count and name_prefix enable scale-up and scale-down triggers = { count = var.worker["count"] name_prefix = "${var.name_prefix}"