-
Notifications
You must be signed in to change notification settings - Fork 48
WIP: feat: updates for 1.76.3, update PER DCs and update deprecated apis #546
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
prb112
wants to merge
20
commits into
ocp-power-automation:main
Choose a base branch
from
prb112:terraform-1.76.2-updates
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
0cb854d
feat: updates for 1.76.3, update PER DCs and update deprecated apis
prb112 3d5d2d2
build(deps): ibm/ocp4-upi-compute-powervs-ibmcloud is updated to IBM-…
prb112 acf8229
fix: network was improperly the private network and switched to the p…
prb112 1c7cd76
fix: add us-east to avoid branching for cloud_connections
prb112 ab66c43
fix: changed the default 9.9.9.9 to use 161.26.0.10; 161.26.0.11 as t…
prb112 2fbd79a
OpenShiftP-284: change to to account for the proper DNS setting
prb112 b845b47
OpenShiftP-284: change docs for ext_dns
prb112 0108f48
fix: account for codeload issues
prb112 ccd1386
fix: conflict between python-unversioned-command
prb112 0339343
fix: account for multiple dns_forwarders
prb112 60fa66b
fix: update to latest terraform v1.80.3
prb112 6e8b0fa
fix: update to latest terraform v1.80.4
prb112 52113bf
fix: account for different delimiters for different networks
prb112 93db56b
fix: dns format, need to fix ocp4-helpernode
prb112 92a00c8
fix: dns format, need to fix ocp4-helpernode
prb112 f7d46f6
fix: add delay when load balancers aren't yet ready
prb112 09f6a66
fix: adjust the api sync point
prb112 ba2de08
refactor: adjusted the escape of the shell
prb112 7961ea7
fix: override the default timezone to utc
prb112 043463a
fix: missed conditional for force utc
prb112 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,3 +12,4 @@ crash.*.log | |
|
|
||
| # terraform lock files | ||
| .terraform.lock.hcl | ||
| .DS_Store | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -52,10 +52,8 @@ locals { | |
| bastion_storage_pool = local.project_bastion_image_pool == "" ? null : local.project_bastion_image_pool | ||
| } | ||
|
|
||
| # Copy image from catalog if not in the project and present in catalog | ||
| resource "ibm_pi_image" "bastion" { | ||
| count = length(local.project_bastion_image) == 0 && length(local.catalog_bastion_image) == 1 ? 1 : 0 | ||
| pi_image_name = var.rhel_image_name | ||
| pi_image_id = local.catalog_bastion_image[0].image_id | ||
| pi_cloud_instance_id = var.service_instance_id | ||
| } | ||
|
|
@@ -366,7 +364,7 @@ resource "null_resource" "bastion_packages" { | |
|
|
||
| provisioner "remote-exec" { | ||
| inline = [ | ||
| "#sudo yum update -y --skip-broken", | ||
| "sudo yum update -y --skip-broken", | ||
| "sudo yum install -y wget jq git net-tools vim python3 tar" | ||
| ] | ||
| } | ||
|
|
@@ -447,20 +445,41 @@ resource "null_resource" "rhel83_fix" { | |
| } | ||
| } | ||
|
|
||
| resource "ibm_pi_network_port" "bastion_vip" { | ||
| resource "null_resource" "force_use_utc" { | ||
| count = var.force_utc ? local.bastion_count : 0 | ||
| depends_on = [null_resource.rhel83_fix] | ||
|
|
||
| connection { | ||
| type = "ssh" | ||
| user = var.rhel_username | ||
| host = data.ibm_pi_instance_ip.bastion_public_ip[count.index].external_ip | ||
| private_key = var.private_key | ||
| agent = var.ssh_agent | ||
| timeout = "${var.connection_timeout}m" | ||
| } | ||
| provisioner "remote-exec" { | ||
| inline = [ | ||
| "sudo timedatectl set-timezone UTC", | ||
| ] | ||
| } | ||
| } | ||
|
|
||
| resource "ibm_pi_network_interface" "bastion_vip" { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| count = local.bastion_count > 1 ? 1 : 0 | ||
| depends_on = [ibm_pi_instance.bastion] | ||
|
|
||
| pi_network_name = data.ibm_pi_network.network.pi_network_name | ||
| pi_cloud_instance_id = var.service_instance_id | ||
| pi_network_id = data.ibm_pi_network.network.id | ||
| pi_name = "bastion_vip" | ||
| } | ||
|
|
||
| resource "ibm_pi_network_port" "bastion_internal_vip" { | ||
| resource "ibm_pi_network_interface" "bastion_internal_vip" { | ||
| count = local.bastion_count > 1 ? 1 : 0 | ||
| depends_on = [ibm_pi_instance.bastion] | ||
|
|
||
| pi_network_name = ibm_pi_network.public_network.pi_network_name | ||
| pi_cloud_instance_id = var.service_instance_id | ||
| pi_network_id = ibm_pi_network.public_network.id | ||
| pi_name = "bastion_internal_vip" | ||
| } | ||
|
|
||
| resource "ibm_pi_cloud_connection" "cloud_connection" { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -82,3 +82,4 @@ variable "proxy" {} | |
| variable "fips_compliant" {} | ||
|
|
||
| variable "create_cloud_connection" {} | ||
| variable "force_utc" {} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,7 +26,7 @@ terraform { | |
| } | ||
| ibm = { | ||
| source = "IBM-Cloud/ibm" | ||
| version = "1.60.0" | ||
| version = "1.80.4" | ||
| } | ||
|
|
||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -71,17 +71,18 @@ module "prepare" { | |
| proxy = var.proxy | ||
| fips_compliant = var.fips_compliant | ||
| create_cloud_connection = local.create_cloud_connection | ||
| force_utc = var.force_utc | ||
| } | ||
|
|
||
| data "ibm_pi_workspace" "workspace" { | ||
| pi_cloud_instance_id = var.service_instance_id | ||
| } | ||
|
|
||
| locals { | ||
| # PER doc reference: https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-per | ||
| is_per = contains(["dal10", "dal12", "fra04", "fra05", "wdc06", "wdc07", "mad02", "mad04", "sao01", "sao04"], var.ibmcloud_zone) | ||
| # PER doc reference: https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-per#dcs-per | ||
| is_per = contains(["dal10", "dal12", "dal13", "dal14", "fra04", "fra05", "lon04", "lon06", "mad02", "mad04", "osa21", "sao01", "sao04", "syd04", "syd05", "tok04", "tor01", "wdc04", "wdc06", "wdc07", "us-east"], var.ibmcloud_zone) | ||
| create_cloud_connection = var.use_ibm_cloud_services && var.ibm_cloud_connection_name == "" && !local.is_per | ||
| tgw_network = module.prepare.cloud_connection_name == "" ? data.ibm_pi_workspace.workspace.pi_workspace_details.crn : module.prepare.cloud_connection_name | ||
| tgw_network = module.prepare.cloud_connection_name == "" ? data.ibm_pi_workspace.workspace.pi_workspace_details[0].crn : module.prepare.cloud_connection_name | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. pi_workspace_details is returned as a list, so we pick the first one. |
||
| } | ||
|
|
||
| module "nodes" { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be a problem in ssh command output, DNS host entries, wildcard DNS. Somehow can we get the public IP from network?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @yussufsh
I looked at the terraform-provider-ibm, it's unclear if this is the public IP address. Further looking into the api, it's not clear the API network, instance et cetra is suitable for returning the public ip (I anticipate they built it for VPC entry into the PowerVS workspace).
I'll have to experiment it a bit. I'll do that on Monday.
Thanks,
Paul