Skip to content

Commit 451c552

Browse files
authored
Merge pull request #110 from oracle-devrel/develop-temp
Automation Toolkit Release v2024.3.0
2 parents ddf27e9 + 9e513eb commit 451c552

File tree

305 files changed

+7880
-11678
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

305 files changed

+7880
-11678
lines changed

OCIWorkVMStack/data_sources.tf

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
1-
/*
2-
data "oci_identity_availability_domain" "ad" {
3-
compartment_id = var.tenancy_ocid
4-
ad_number = var.availability_domain_number
5-
}
6-
*/
7-
8-
data "oci_identity_tenancy" "tenancy" {
9-
#Required
10-
tenancy_id = var.tenancy_ocid
11-
}
12-
13-
data "oci_core_subnet" "subnet" {
14-
#Required
15-
count = var.vcn_strategy == "Use Existing VCN" ? 1 : 0
16-
subnet_id = var.existing_subnet_id
17-
}
18-
19-
data "oci_identity_compartment" "compartment" {
20-
#Required
21-
id = local.instance_compartment_ocid
22-
depends_on = [module.instance]
23-
}
24-
25-
data "oci_core_images" "oracle_linux" {
26-
compartment_id = var.tenancy_ocid
27-
operating_system = "Oracle Linux"
28-
shape = var.instance_shape
29-
#display_name = var.instance_os_version
30-
sort_by = "TIMECREATED"
31-
sort_order = "DESC"
32-
state = "AVAILABLE"
33-
34-
#filter restricts to OL
35-
filter {
36-
name = "operating_system_version"
37-
values = ["${local.os_version}"]
38-
regex = false
39-
}
40-
}
1+
/*
2+
data "oci_identity_availability_domain" "ad" {
3+
compartment_id = var.tenancy_ocid
4+
ad_number = var.availability_domain_number
5+
}
6+
*/
7+
8+
data "oci_identity_tenancy" "tenancy" {
9+
#Required
10+
tenancy_id = var.tenancy_ocid
11+
}
12+
13+
data "oci_core_subnet" "subnet" {
14+
#Required
15+
count = var.vcn_strategy == "Use Existing VCN" ? 1 : 0
16+
subnet_id = var.existing_subnet_id
17+
}
18+
19+
data "oci_identity_compartment" "compartment" {
20+
#Required
21+
id = local.instance_compartment_ocid
22+
depends_on = [module.instance]
23+
}
24+
25+
data "oci_core_images" "oracle_linux" {
26+
compartment_id = var.tenancy_ocid
27+
operating_system = "Oracle Linux"
28+
shape = var.instance_shape
29+
#display_name = var.instance_os_version
30+
sort_by = "TIMECREATED"
31+
sort_order = "DESC"
32+
state = "AVAILABLE"
33+
34+
#filter restricts to OL
35+
filter {
36+
name = "operating_system_version"
37+
values = ["${local.os_version}"]
38+
regex = false
39+
}
40+
}

OCIWorkVMStack/installToolkit.sh

Lines changed: 0 additions & 137 deletions
This file was deleted.

OCIWorkVMStack/locals.tf

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
locals {
2-
instance_compartment_ocid = var.instance_compartment_strategy == "Create New Compartment - Stack must be provisioned in home region" ? module.compartment[0].compartment_tf_id : var.instance_compartment_ocid
3-
#vcn_compartment_ocid = var.vcn_strategy == "Use Existing VCN" ? var.vcn_compartment_ocid : module.compartment[0].compartment_tf_id
4-
vcn_compartment_ocid = var.vcn_strategy == "Use Existing VCN" ? var.vcn_compartment_ocid : local.instance_compartment_ocid
5-
nsg_id = var.assign_existing_nsg == true ? var.existing_nsg_id : null
6-
is_public_sub = var.vcn_strategy == "Use Existing VCN" ? !data.oci_core_subnet.subnet[0].prohibit_public_ip_on_vnic : false
7-
assignPublicIP = var.vcn_strategy == "Create New VCN" ? var.assign_public_ip : ((local.is_public_sub && var.assign_publicip_existing_subnet) == true ? true : false)
8-
tenancy_name = data.oci_identity_tenancy.tenancy.name
9-
10-
# Logic to select Oracle Autonomous Linux 7 platform image (version pegged in data source filter)
11-
#platform_image_id = data.oci_core_images.ol7.images[0].id
12-
# Logic to choose a custom image or a marketplace image.
13-
#compute_image_id = var.mp_subscription_enabled ? var.mp_listing_resource_id : var.instance_image_ocid
14-
# Local to control subscription to Marketplace image.
15-
mp_subscription_enabled = var.mp_subscription_enabled ? 1 : 0
16-
17-
# Marketplace Image listing variables - required for subscription only
18-
listing_id = var.mp_listing_id
19-
listing_resource_id = var.mp_listing_resource_id
20-
listing_resource_version = var.mp_listing_resource_version
21-
22-
os_version = var.instance_os_version == "Oracle-Linux-9" ? 9 : (var.instance_os_version == "Oracle-Linux-8" ? 8 : 7.9)
23-
24-
instance_image_ocid = data.oci_core_images.oracle_linux.images[1].id
25-
26-
}
1+
locals {
2+
instance_compartment_ocid = var.instance_compartment_strategy == "Create New Compartment - Stack must be provisioned in home region" ? module.compartment[0].compartment_tf_id : var.instance_compartment_ocid
3+
#vcn_compartment_ocid = var.vcn_strategy == "Use Existing VCN" ? var.vcn_compartment_ocid : module.compartment[0].compartment_tf_id
4+
vcn_compartment_ocid = var.vcn_strategy == "Use Existing VCN" ? var.vcn_compartment_ocid : local.instance_compartment_ocid
5+
nsg_id = var.assign_existing_nsg == true ? var.existing_nsg_id : null
6+
is_public_sub = var.vcn_strategy == "Use Existing VCN" ? !data.oci_core_subnet.subnet[0].prohibit_public_ip_on_vnic : false
7+
assignPublicIP = var.vcn_strategy == "Create New VCN" ? var.assign_public_ip : ((local.is_public_sub && var.assign_publicip_existing_subnet) == true ? true : false)
8+
tenancy_name = data.oci_identity_tenancy.tenancy.name
9+
10+
# Logic to select Oracle Autonomous Linux 7 platform image (version pegged in data source filter)
11+
#platform_image_id = data.oci_core_images.ol7.images[0].id
12+
# Logic to choose a custom image or a marketplace image.
13+
#compute_image_id = var.mp_subscription_enabled ? var.mp_listing_resource_id : var.instance_image_ocid
14+
# Local to control subscription to Marketplace image.
15+
mp_subscription_enabled = var.mp_subscription_enabled ? 1 : 0
16+
17+
# Marketplace Image listing variables - required for subscription only
18+
listing_id = var.mp_listing_id
19+
listing_resource_id = var.mp_listing_resource_id
20+
listing_resource_version = var.mp_listing_resource_version
21+
22+
os_version = var.instance_os_version == "Oracle-Linux-9" ? 9 : (var.instance_os_version == "Oracle-Linux-8" ? 8 : 7.9)
23+
24+
instance_image_ocid = data.oci_core_images.oracle_linux.images[1].id
25+
26+
}

OCIWorkVMStack/main.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ module "instance" {
4343
ssh_public_key = var.ssh_public_key
4444
assign_public_ip = local.assignPublicIP
4545
cloud_init_script = var.cloud_init_script
46+
tenancy_ocid = var.tenancy_ocid
47+
current_user_ocid = var.current_user_ocid
48+
config_region = var.region
49+
tenancy_name = local.tenancy_name
4650
}
4751

4852
# This resource will wait for ~ 15 min to cloud init script to completed cd3 related steps

OCIWorkVMStack/modules/compute/instance.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ resource "oci_core_instance" "instances" {
2424
}
2525
metadata = {
2626
ssh_authorized_keys = var.ssh_public_key
27+
tenancy_ocid = var.tenancy_ocid
28+
tenancy_name = var.tenancy_name
29+
current_user_ocid = var.current_user_ocid
30+
config_region = var.config_region
2731
user_data = fileexists("${path.root}/scripts/${var.cloud_init_script}") ? "${base64encode(file("${path.root}/scripts/${var.cloud_init_script}"))}" : null
2832
}
2933

OCIWorkVMStack/modules/compute/variables.tf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,19 @@ variable "cloud_init_script" {
7878
type = string
7979
default = "installToolkit.sh"
8080
}
81+
82+
variable "tenancy_ocid" {
83+
type = string
84+
}
85+
86+
variable "current_user_ocid" {
87+
type = string
88+
}
89+
90+
variable "tenancy_name" {
91+
type = string
92+
}
93+
94+
variable "config_region" {
95+
type = string
96+
}

0 commit comments

Comments
 (0)