Skip to content

Commit e89ba55

Browse files
Terraform Team Automationvarakali
authored andcommitted
Added - Support for Fleet Patching Service for ExaCS and ExaCC
1 parent 08a1e4b commit e89ba55

27 files changed

+6389
-0
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
variable "tenancy_ocid" {
2+
}
3+
4+
variable "ssh_public_key" {
5+
}
6+
7+
variable "region" {
8+
}
9+
10+
variable "compartment_id" {
11+
}
12+
13+
variable "db_target_1" {
14+
}
15+
16+
variable "db_target_2" {
17+
}
18+
19+
variable "db_software_image_1" {
20+
}
21+
22+
variable defined_tag_namespace_name {
23+
default = ""
24+
}
25+
26+
resource "oci_identity_tag_namespace" "tag-namespace1" {
27+
#Required
28+
compartment_id = "${var.tenancy_ocid}"
29+
description = "example tag namespace"
30+
name = "${var.defined_tag_namespace_name != "" ? var.defined_tag_namespace_name : "example-tag-namespace-all"}"
31+
32+
is_retired = false
33+
}
34+
35+
resource "oci_identity_tag" "tag1" {
36+
#Required
37+
description = "example tag"
38+
name = "example-tag"
39+
tag_namespace_id = "${oci_identity_tag_namespace.tag-namespace1.id}"
40+
41+
is_retired = false
42+
}
43+
44+
resource "oci_fleet_software_update_fsu_collection" "test_fsu_collection" {
45+
compartment_id = "${var.compartment_id}"
46+
fleet_discovery {
47+
strategy = "TARGET_LIST"
48+
targets = ["${var.db_target_1}"]
49+
}
50+
lifecycle {
51+
ignore_changes = ["defined_tags", "system_tags", "freeform_tags"]
52+
}
53+
service_type = "EXACS"
54+
source_major_version = "DB_19"
55+
type = "DB"
56+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
variable "tenancy_ocid" {
2+
}
3+
4+
variable "ssh_public_key" {
5+
}
6+
7+
variable "region" {
8+
}
9+
10+
variable "compartment_id" {
11+
}
12+
13+
variable "gi_target_1" {
14+
}
15+
16+
variable "gi_target_2" {
17+
}
18+
19+
variable defined_tag_namespace_name {
20+
default = ""
21+
}
22+
23+
resource "oci_identity_tag_namespace" "tag-namespace1" {
24+
#Required
25+
compartment_id = "${var.tenancy_ocid}"
26+
description = "example tag namespace"
27+
name = "${var.defined_tag_namespace_name != "" ? var.defined_tag_namespace_name : "example-tag-namespace-all"}"
28+
29+
is_retired = false
30+
}
31+
32+
resource "oci_identity_tag" "tag1" {
33+
#Required
34+
description = "example tag"
35+
name = "example-tag"
36+
tag_namespace_id = "${oci_identity_tag_namespace.tag-namespace1.id}"
37+
38+
is_retired = false
39+
}
40+
41+
resource "oci_fleet_software_update_fsu_collection" "test_fsu_collection" {
42+
compartment_id = "${var.compartment_id}"
43+
fleet_discovery {
44+
strategy = "TARGET_LIST"
45+
targets = ["${var.gi_target_1}"]
46+
}
47+
lifecycle {
48+
ignore_changes = ["defined_tags", "system_tags", "freeform_tags"]
49+
}
50+
service_type = "EXACS"
51+
source_major_version = "GI_19"
52+
type = "GI"
53+
}
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
variable "tenancy_ocid" {
2+
}
3+
4+
variable "ssh_public_key" {
5+
}
6+
7+
variable "region" {
8+
}
9+
10+
variable "compartment_id" {
11+
}
12+
13+
variable "db_target_1" {
14+
}
15+
16+
variable "db_target_2" {
17+
}
18+
19+
variable "db_software_image_1" {
20+
}
21+
22+
variable "InstanceImageOCID" {
23+
type = "map"
24+
default = {
25+
// See https://docs.us-phoenix-1.oraclecloud.com/images/
26+
// Oracle-provided image "Oracle-Linux-7.5-2018.10.16-0"
27+
}
28+
}
29+
// Gets a list of all Oracle Linux 7.5 images that support a given Instance shape
30+
data "oci_core_images" "supported_shape_images" {
31+
compartment_id = "${var.tenancy_ocid}"
32+
shape = "VM.Standard2.1"
33+
operating_system = "Oracle Linux"
34+
}
35+
36+
37+
resource "oci_fleet_software_update_fsu_collection" "test_fsu_collection" {
38+
compartment_id = "${var.compartment_id}"
39+
fleet_discovery {
40+
strategy = "TARGET_LIST"
41+
targets = ["${var.db_target_1}"]
42+
}
43+
lifecycle {
44+
ignore_changes = ["defined_tags", "system_tags", "freeform_tags"]
45+
}
46+
service_type = "EXACS"
47+
source_major_version = "DB_19"
48+
type = "DB"
49+
}
50+
51+
variable defined_tag_namespace_name {
52+
default = ""
53+
}
54+
55+
resource "oci_identity_tag_namespace" "tag-namespace1" {
56+
#Required
57+
compartment_id = "${var.tenancy_ocid}"
58+
description = "example tag namespace"
59+
name = "${var.defined_tag_namespace_name != "" ? var.defined_tag_namespace_name : "example-tag-namespace-all"}"
60+
61+
is_retired = false
62+
}
63+
64+
resource "oci_identity_tag" "tag1" {
65+
#Required
66+
description = "example tag"
67+
name = "example-tag"
68+
tag_namespace_id = "${oci_identity_tag_namespace.tag-namespace1.id}"
69+
70+
is_retired = false
71+
}
72+
73+
resource "oci_fleet_software_update_fsu_cycle" "test_fsu_cycle" {
74+
compartment_id = "${var.compartment_id}"
75+
fsu_collection_id = "${oci_fleet_software_update_fsu_collection.test_fsu_collection.id}"
76+
goal_version_details {
77+
software_image_id = "${var.db_software_image_1}"
78+
type = "IMAGE_ID"
79+
}
80+
lifecycle {
81+
ignore_changes = ["defined_tags", "system_tags", "freeform_tags"]
82+
}
83+
type = "PATCH"
84+
}
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
variable "tenancy_ocid" {
2+
}
3+
4+
variable "ssh_public_key" {
5+
}
6+
7+
variable "region" {
8+
}
9+
10+
variable "compartment_id" {
11+
}
12+
13+
variable "db_target_1" {
14+
}
15+
16+
variable "db_target_2" {
17+
}
18+
19+
variable "InstanceImageOCID" {
20+
type = "map"
21+
default = {
22+
// See https://docs.us-phoenix-1.oraclecloud.com/images/
23+
// Oracle-provided image "Oracle-Linux-7.5-2018.10.16-0"
24+
}
25+
}
26+
// Gets a list of all Oracle Linux 7.5 images that support a given Instance shape
27+
data "oci_core_images" "supported_shape_images" {
28+
compartment_id = "${var.tenancy_ocid}"
29+
shape = "VM.Standard2.1"
30+
operating_system = "Oracle Linux"
31+
}
32+
33+
34+
resource "oci_fleet_software_update_fsu_collection" "test_fsu_collection" {
35+
compartment_id = "${var.compartment_id}"
36+
fleet_discovery {
37+
strategy = "TARGET_LIST"
38+
targets = ["${var.db_target_1}"]
39+
}
40+
lifecycle {
41+
ignore_changes = ["defined_tags", "system_tags", "freeform_tags"]
42+
}
43+
service_type = "EXACS"
44+
source_major_version = "DB_19"
45+
type = "DB"
46+
}
47+
48+
variable defined_tag_namespace_name {
49+
default = ""
50+
}
51+
52+
resource "oci_identity_tag_namespace" "tag-namespace1" {
53+
#Required
54+
compartment_id = "${var.tenancy_ocid}"
55+
description = "example tag namespace"
56+
name = "${var.defined_tag_namespace_name != "" ? var.defined_tag_namespace_name : "example-tag-namespace-all"}"
57+
58+
is_retired = false
59+
}
60+
61+
resource "oci_identity_tag" "tag1" {
62+
#Required
63+
description = "example tag"
64+
name = "example-tag"
65+
tag_namespace_id = "${oci_identity_tag_namespace.tag-namespace1.id}"
66+
67+
is_retired = false
68+
}
69+
70+
resource "oci_fleet_software_update_fsu_cycle" "test_fsu_cycle" {
71+
compartment_id = "${var.compartment_id}"
72+
fsu_collection_id = "${oci_fleet_software_update_fsu_collection.test_fsu_collection.id}"
73+
goal_version_details {
74+
type = "VERSION"
75+
version = "19.17.0.0.0"
76+
}
77+
lifecycle {
78+
ignore_changes = ["defined_tags", "system_tags", "freeform_tags"]
79+
}
80+
type = "PATCH"
81+
}
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
variable "tenancy_ocid" {
2+
}
3+
4+
variable "ssh_public_key" {
5+
}
6+
7+
variable "region" {
8+
}
9+
10+
variable "compartment_id" {
11+
}
12+
13+
variable "gi_target_1" {
14+
}
15+
16+
variable "gi_target_2" {
17+
}
18+
19+
variable "db_grid_software_image_1" {
20+
}
21+
22+
variable "InstanceImageOCID" {
23+
type = "map"
24+
default = {
25+
// See https://docs.us-phoenix-1.oraclecloud.com/images/
26+
// Oracle-provided image "Oracle-Linux-7.5-2018.10.16-0"
27+
}
28+
}
29+
// Gets a list of all Oracle Linux 7.5 images that support a given Instance shape
30+
data "oci_core_images" "supported_shape_images" {
31+
compartment_id = "${var.tenancy_ocid}"
32+
shape = "VM.Standard2.1"
33+
operating_system = "Oracle Linux"
34+
}
35+
36+
37+
resource "oci_fleet_software_update_fsu_collection" "test_fsu_collection" {
38+
compartment_id = "${var.compartment_id}"
39+
fleet_discovery {
40+
strategy = "TARGET_LIST"
41+
targets = ["${var.gi_target_1}"]
42+
}
43+
lifecycle {
44+
ignore_changes = ["defined_tags", "system_tags", "freeform_tags"]
45+
}
46+
service_type = "EXACS"
47+
source_major_version = "GI_19"
48+
type = "GI"
49+
}
50+
51+
variable defined_tag_namespace_name {
52+
default = ""
53+
}
54+
55+
resource "oci_identity_tag_namespace" "tag-namespace1" {
56+
#Required
57+
compartment_id = "${var.tenancy_ocid}"
58+
description = "example tag namespace"
59+
name = "${var.defined_tag_namespace_name != "" ? var.defined_tag_namespace_name : "example-tag-namespace-all"}"
60+
61+
is_retired = false
62+
}
63+
64+
resource "oci_identity_tag" "tag1" {
65+
#Required
66+
description = "example tag"
67+
name = "example-tag"
68+
tag_namespace_id = "${oci_identity_tag_namespace.tag-namespace1.id}"
69+
70+
is_retired = false
71+
}
72+
73+
resource "oci_fleet_software_update_fsu_cycle" "test_fsu_cycle" {
74+
compartment_id = "${var.compartment_id}"
75+
fsu_collection_id = "${oci_fleet_software_update_fsu_collection.test_fsu_collection.id}"
76+
goal_version_details {
77+
software_image_id = "${var.db_grid_software_image_1}"
78+
type = "IMAGE_ID"
79+
}
80+
lifecycle {
81+
ignore_changes = ["defined_tags", "system_tags", "freeform_tags"]
82+
}
83+
type = "PATCH"
84+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Overview
2+
This is a Terraform configuration that creates the Fleet Software Update service on Oracle Cloud Infrastructure.
3+
4+
The Terraform code is used to create a Resource Manager stack, that creates the required resources and configures the application on the created resources.

0 commit comments

Comments
 (0)