Skip to content

Commit 363c5df

Browse files
Update RHEL solution to use image OCID (#399)
The image "Oracle-Linux-7.4-2017.09.29-0" is no longer being returned from the list_images call, so use the OCID directly (which is the new guidance anyway, we just haven't yet switched all of the solutions and examples over). Note that we might want to update this to a newer image, such as "Oracle-Linux-7.4-2017.11.15-0" or "Oracle-Linux-7.4-2017.12.18-0", but that is pending testing using those versions.
1 parent 9134c54 commit 363c5df

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

docs/solutions/rhel74_image/configuration.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ variable "build_env" {
2020
type = "map"
2121
default = {
2222
compartment = "<Compartment display name>"
23-
ad = "<the AD you want>"
23+
ad = "<The number of the availability domain to use - 1, 2, or 3>"
2424
vcn = "<VCN name>"
2525
subnet = "<subnet name in compartment in ad in vcn>"
2626
}

docs/solutions/rhel74_image/datasources.tf

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,6 @@ data "oci_core_subnets" "subnet" {
3535

3636
}
3737

38-
# Gets the OCID of the image. This technique is for example purposes only.
39-
# The results of oci_core_images may change over time for Oracle-provided images,
40-
# so the only sure way to get the correct OCID is to supply it directly.
41-
42-
data "oci_core_images" "image" {
43-
compartment_id = "${data.oci_identity_compartments.compartment.compartments.0.id}"
44-
display_name = "${var.ipxe_instance["image"]}"
45-
}
46-
4738
data "external" "ipxe_gen" {
4839
program = [ "/bin/bash", "./ipxe_gen.sh"]
4940
query = {

docs/solutions/rhel74_image/ipxe.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ resource "oci_core_instance" "ipxe_node" {
44
availability_domain = "${data.oci_identity_availability_domains.ad.availability_domains.0.name}"
55
compartment_id = "${data.oci_identity_compartments.compartment.compartments.0.id}"
66
display_name = "${var.ipxe_instance["name"]}"
7-
image = "${data.oci_core_images.image.images.0.id}"
7+
image = "${var.ipxe_instance_image_ocid[var.region]}"
88
shape = "${var.ipxe_instance["shape"]}"
99
subnet_id = "${data.oci_core_subnets.subnet.subnets.0.id}"
1010
hostname_label = "${var.ipxe_instance["hostname"]}"

docs/solutions/rhel74_image/variable.tf

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,20 @@ variable "ipxe_instance" {
2222
default = {
2323
name = "ipxe-rhel74"
2424
hostname = "ipxe-rhel74"
25-
image = "Oracle-Linux-7.4-2017.09.29-0"
2625
shape = "VM.Standard1.1"
2726
}
2827
}
2928

29+
variable "ipxe_instance_image_ocid" {
30+
type = "map"
31+
default = {
32+
// Use the image "Oracle-Linux-7.4-2017.09.29-0"
33+
us-phoenix-1 = "ocid1.image.oc1.phx.aaaaaaaa3g2xpzlbrrdknqcjtzv2tvxcofjc55vdcmpxdlbohmtt7encpana"
34+
us-ashburn-1 = "ocid1.image.oc1.iad.aaaaaaaaawy2hh3nreaesyqcdp4m6csg4lwen6ya2njgiyjeu5sodiahlaxq"
35+
eu-frankfurt-1 = "ocid1.image.oc1.eu-frankfurt1.aaaaaaaaydqkfzrcejyllfiwhcfqob2yyvkmytghwki6zcmhyciyruinokva"
36+
}
37+
}
38+
3039
variable "region_all_zeros_ocid" {
3140
type = "map"
3241
default = {

0 commit comments

Comments
 (0)