Skip to content

Commit 65645ab

Browse files
authored
upgraded default version of Oracle Linux to 8 (#27)
Added a new variable that would allow existing users to use Oracle Linux 7.9 for backward compatibility. Also removed superflous check on image id and updated docs.
1 parent d165b1e commit 65645ab

File tree

5 files changed

+25
-13
lines changed

5 files changed

+25
-13
lines changed

datasources.tf

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ data "oci_core_vcn" "vcn" {
2929
data "template_file" "oracle_template" {
3030
template = file("${path.module}/scripts/operator.template.sh")
3131

32-
count = (var.operator_enabled == true && var.operator_image_id == "Oracle") ? 1 : 0
32+
vars = {
33+
ol = var.operating_system_version
34+
}
35+
36+
count = (var.operator_enabled == true) ? 1 : 0
3337
}
3438

3539
data "template_file" "oracle_cloud_init_file" {
@@ -41,13 +45,13 @@ data "template_file" "oracle_cloud_init_file" {
4145
timezone = var.timezone
4246
}
4347

44-
count = (var.operator_enabled == true && var.operator_image_id == "Oracle") ? 1 : 0
48+
count = (var.operator_enabled == true) ? 1 : 0
4549
}
4650

4751
data "oci_core_images" "oracle_images" {
4852
compartment_id = var.compartment_id
4953
operating_system = "Oracle Linux"
50-
operating_system_version = "7.9"
54+
operating_system_version = var.operating_system_version
5155
shape = lookup(var.operator_shape, "shape", "VM.Standard.E2.2")
5256
sort_by = "TIMECREATED"
5357
}

docs/terraformoptions.adoc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,16 @@ Ensure you review the {uri-terraform-dependencies}[dependencies].
152152
memory=4,
153153
boot_volume_size=50
154154
}`
155-
156155
|`operator_upgrade`
157156
|Whether to upgrade the operator host packages after provisioning. It's useful to set this to false during development/testing so the operator is provisioned faster.
158157
|true/false
159158
|true
160159

160+
|`operating_system_version`
161+
|The version of the Oracle Linux to use..
162+
|
163+
|8
164+
161165
|`ssh_public_key`
162166
|the content of the ssh public key used to access the operator. set this or the ssh_public_key_path
163167
|

scripts/operator.template.sh

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,12 @@
33
# Copyright 2017, 2019, Oracle Corporation and/or affiliates. All rights reserved.
44
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
55

6-
# yum update --security
6+
if [ ${ol} = 8 ]; then
7+
dnf -y upgrade --security
8+
else
9+
yum -y -t update --security
10+
fi
711

8-
# sed -i -e "s/autoinstall\s=\sno/# autoinstall = yes/g" /etc/uptrack/uptrack.conf
9-
10-
# uptrack-upgrade
11-
12-
# pip3 install oci-cli
13-
14-
yum -y -t update --security
15-
sed -i -e "s/autoinstall\s=\sno/# autoinstall = yes/g" /etc/uptrack/uptrack.conf
12+
sed -i -e "s/autoinstall\s=\sno/autoinstall = yes/g" /etc/uptrack/uptrack.conf
1613
uptrack-upgrade -y
1714
pip3 install oci-cli

terraform.tfvars.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ operator_shape = {
4747
boot_volume_size=50
4848
}
4949

50+
operating_system_version = "8"
51+
5052
operator_upgrade = false
5153

5254
ssh_public_key = ""

variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@ variable "operator_shape" {
109109
type = map(any)
110110
}
111111

112+
variable "operating_system_version" {
113+
description = "The version of the Oracle Linux to use."
114+
default = "8"
115+
type = string
116+
}
112117
variable "operator_upgrade" {
113118
description = "Whether to upgrade the operator host packages after provisioning. It's useful to set this to false during development/testing so the operator is provisioned faster."
114119
default = false

0 commit comments

Comments
 (0)