Skip to content

Commit fba5ba3

Browse files
committed
fix: versions file in submodules
additional fixes: - for default bastion os version when using Autonomous - disabling bastion addon when using different OS versions - operator await should only trigger if bastion is created Signed-off-by: Ali Mukadam <[email protected]>
1 parent b9a02e5 commit fba5ba3

File tree

9 files changed

+72
-27
lines changed

9 files changed

+72
-27
lines changed

module-bastion.tf

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,19 @@ module "bastion" {
4646
compartment_id = local.compartment_id
4747

4848
# Bastion
49-
assign_dns = var.assign_dns
50-
availability_domain = coalesce(var.bastion_availability_domain, lookup(local.ad_numbers_to_names, local.ad_numbers[0]))
51-
image_id = local.bastion_image_id
52-
nsg_ids = try(compact(flatten([var.bastion_nsg_ids, [try(module.network.bastion_nsg_id, null)]])), [])
53-
is_public = var.bastion_is_public
54-
shape = var.bastion_shape
55-
ssh_private_key = sensitive(local.ssh_private_key) # to await cloud-init completion
56-
ssh_public_key = local.ssh_public_key
57-
subnet_id = try(module.network.bastion_subnet_id, "") # safe destroy; validated in submodule
58-
timezone = var.timezone
59-
upgrade = var.bastion_upgrade
60-
user = var.bastion_user
49+
assign_dns = var.assign_dns
50+
availability_domain = coalesce(var.bastion_availability_domain, lookup(local.ad_numbers_to_names, local.ad_numbers[0]))
51+
bastion_image_os_version = var.bastion_image_os_version
52+
image_id = local.bastion_image_id
53+
nsg_ids = try(compact(flatten([var.bastion_nsg_ids, [try(module.network.bastion_nsg_id, null)]])), [])
54+
is_public = var.bastion_is_public
55+
shape = var.bastion_shape
56+
ssh_private_key = sensitive(local.ssh_private_key) # to await cloud-init completion
57+
ssh_public_key = local.ssh_public_key
58+
subnet_id = try(module.network.bastion_subnet_id, "") # safe destroy; validated in submodule
59+
timezone = var.timezone
60+
upgrade = var.bastion_upgrade
61+
user = var.bastion_user
6162

6263
# Standard tags as defined if enabled for use, or freeform
6364
# User-provided tags are merged last and take precedence

module-operator.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ locals {
4444
}
4545

4646
module "operator" {
47-
count = var.create_operator ? 1 : 0
47+
count = var.create_bastion && var.create_operator ? 1 : 0
4848
source = "./modules/operator"
4949
state_id = local.state_id
5050
compartment_id = local.compartment_id

modules/bastion/cloudinit.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ data "cloudinit_config" "bastion" {
1111
# https://cloudinit.readthedocs.io/en/latest/reference/examples.html#run-commands-on-first-boot
1212
content = <<-EOT
1313
runcmd:
14-
- dnf config-manager --disable ol8_addons --disable ol8_appstream
14+
- dnf config-manager --disable ol${var.bastion_image_os_version}_addons --disable ol${var.bastion_image_os_version}_appstream
1515
EOT
1616
}
1717

modules/bastion/variables.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ variable "state_id" { type = string }
88
# Bastion
99
variable "assign_dns" { type = bool }
1010
variable "availability_domain" { type = string }
11+
variable "bastion_image_os_version" {type = string}
1112
variable "image_id" { type = string }
1213
variable "is_public" { type = bool }
1314
variable "nsg_ids" { type = list(string) }

modules/cluster/versions.tf

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,16 @@
1-
../../versions.tf
1+
# Copyright (c) 2017, 2024 Oracle Corporation and/or its affiliates.
2+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl
3+
4+
terraform {
5+
required_version = ">= 1.3.0"
6+
7+
required_providers {
8+
9+
oci = {
10+
configuration_aliases = [oci.home]
11+
source = "oracle/oci"
12+
version = ">= 4.119.0"
13+
}
14+
15+
}
16+
}

modules/iam/versions.tf

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,19 @@
1-
../../versions.tf
1+
# Copyright (c) 2017, 2024 Oracle Corporation and/or its affiliates.
2+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl
3+
4+
terraform {
5+
required_version = ">= 1.3.0"
6+
7+
required_providers {
8+
oci = {
9+
configuration_aliases = [oci.home]
10+
source = "oracle/oci"
11+
version = ">= 4.119.0"
12+
}
13+
14+
time = {
15+
source = "hashicorp/time"
16+
version = ">= 0.9.1"
17+
}
18+
}
19+
}

modules/network/versions.tf

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,16 @@
1-
../../versions.tf
1+
# Copyright (c) 2017, 2024 Oracle Corporation and/or its affiliates.
2+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl
3+
4+
terraform {
5+
required_version = ">= 1.3.0"
6+
7+
required_providers {
8+
9+
oci = {
10+
configuration_aliases = [oci.home]
11+
source = "oracle/oci"
12+
version = ">= 4.119.0"
13+
}
14+
15+
}
16+
}

modules/operator/versions.tf

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,23 @@
1-
# Copyright (c) 2017, 2023 Oracle Corporation and/or its affiliates.
1+
# Copyright (c) 2017, 2024 Oracle Corporation and/or its affiliates.
22
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl
33

44
terraform {
5-
required_version = ">= 1.2.0"
5+
required_version = ">= 1.3.0"
66

77
required_providers {
88
cloudinit = {
99
source = "hashicorp/cloudinit"
1010
version = ">= 2.2.0"
1111
}
1212

13-
helm = {
14-
source = "hashicorp/helm"
15-
version = ">= 2.9.0"
16-
}
17-
1813
null = {
1914
source = "hashicorp/null"
2015
version = ">= 3.2.1"
2116
}
2217

2318
oci = {
24-
source = "oracle/oci"
25-
version = ">= 4.119.0"
19+
source = "oracle/oci"
20+
version = ">= 4.119.0"
2621
}
2722
}
2823
}

variables-bastion.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ variable "bastion_image_os" {
6060
}
6161

6262
variable "bastion_image_os_version" {
63-
default = "8.8"
63+
default = "8"
6464
description = "Bastion image operating system version when bastion_image_type = 'platform'."
6565
type = string
6666
}

0 commit comments

Comments
 (0)