Skip to content

Commit

Permalink
Power VS: Add sleep to allow workspace to configure PER
Browse files Browse the repository at this point in the history
  • Loading branch information
mjturek committed Jan 9, 2024
1 parent 43d0bd0 commit e788aa7
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions data/data/powervs/cluster/iaas/iaas.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,8 @@ resource "ibm_resource_instance" "created_service_instance" {
delete = "10m"
}
}
resource "time_sleep" "wait_for_workspace" {
count = var.service_instance_name == "" ? 1 : 0
depends_on = [ibm_resource_instance.created_service_instance]
create_duration = var.wait_for_workspace
}
5 changes: 5 additions & 0 deletions data/data/powervs/cluster/iaas/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,8 @@ variable "service_instance_name" {
type = string
description = "Optionally, the service instance name of an existing object before cluster creation"
}

variable "wait_for_workspace" {
type = string
description = "Time to wait after creating a Power VS workspace to allow PER to initialize"
}
1 change: 1 addition & 0 deletions data/data/powervs/cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,5 @@ module "iaas" {
resource_group = var.powervs_resource_group
powervs_zone = var.powervs_zone
service_instance_name = var.powervs_service_instance_name
wait_for_workspace = var.powervs_wait_for_workspace
}
6 changes: 6 additions & 0 deletions data/data/powervs/variables-powervs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ variable "powervs_service_instance_name" {
description = "Optionally, the service instance name of an existing object before cluster creation"
}

variable "powervs_wait_for_workspace" {
type = string
description = "The seconds wait for the Power VS Workspace after creation, default is 60s"
default = "60s"
}

################################################################
# Configure storage
################################################################
Expand Down

0 comments on commit e788aa7

Please sign in to comment.