Skip to content

Commit

Permalink
OCTOPUS-558: remove_lbs script is updated
Browse files Browse the repository at this point in the history
Signed-off-by: Chandan Abhyankar <chandan.abhyankar@gmail.com>
  • Loading branch information
Chandan-Abhyankar committed Dec 21, 2023
1 parent f151f94 commit 59ed178
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 deletions.
27 changes: 16 additions & 11 deletions modules/7_post/ibmcloud_lb/ibmcloud_lb.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,20 @@ locals {
resource "null_resource" "remove_lbs" {

triggers = {
count_1 = var.worker_1["count"]
count_2 = var.worker_2["count"]
count_3 = var.worker_3["count"]
user = var.rhel_username
timeout = "${var.connection_timeout}m"
name_prefix = "${var.name_prefix}"
private_key = sensitive(file(var.private_key_file))
host = var.bastion_public_ip
agent = var.ssh_agent
ansible_post_path = local.ansible_post_path
count_1 = var.worker_1["count"]
count_2 = var.worker_2["count"]
count_3 = var.worker_3["count"]
user = var.rhel_username
timeout = "${var.connection_timeout}m"
name_prefix = "${var.name_prefix}"
private_key = sensitive(file(var.private_key_file))
host = var.bastion_public_ip
agent = var.ssh_agent
ansible_post_path = local.ansible_post_path
ibmcloud_api_key = var.ibmcloud_api_key
vpc_region = var.vpc_region
resource_group_name = var.resource_group_name
vpc_name = var.vpc_name
}

connection {
Expand Down Expand Up @@ -49,7 +53,8 @@ EOF
on_failure = continue
inline = [<<EOF
cd /root/ocp4-upi-compute-powervs-ibmcloud/intel/lbs/
bash remove_lbs.sh
bash remove_lbs.sh "${self.triggers.ibmcloud_api_key}" "${self.triggers.vpc_region}" "${self.triggers.resource_group_name}" "${self.triggers.vpc_name}"
EOF
]
}
Expand Down
6 changes: 3 additions & 3 deletions modules/7_post/post.tf
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,9 @@ module "haproxy_lb_support" {

# Dev Note: we only execute when CIS, Security Groups and Load Balancers are used
module "ibmcloud_lb_support" {
count = var.ibm_cloud_cis ? 1 : 0
depends_on = [null_resource.patch_nfs_arch_ppc64le]
source = "./ibmcloud_lb"
count = var.ibm_cloud_cis ? 1 : 0
depends_on = [null_resource.patch_nfs_arch_ppc64le]
source = "./ibmcloud_lb"

ssh_agent = var.ssh_agent
rhel_username = var.rhel_username
Expand Down

0 comments on commit 59ed178

Please sign in to comment.