Skip to content

Commit 78b23f3

Browse files
authored
feat: install oci-cli with cloud-init (#73)
* feat: install oci-cli with cloud-init Signed-off-by: Ali Mukadam <[email protected]> * fix: added firewalld Signed-off-by: Ali Mukadam <[email protected]> * fix: removed unused template Signed-off-by: Ali Mukadam <[email protected]> Signed-off-by: Ali Mukadam <[email protected]>
1 parent 8f7d856 commit 78b23f3

File tree

4 files changed

+16
-34
lines changed

4 files changed

+16
-34
lines changed

cloudinit/operator.template.yaml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,21 @@
44
#cloud-config
55
package_upgrade: ${upgrade_operator}
66
timezone: ${operator_timezone}
7-
write_files:
8-
# setup script
9-
- path: "/root/operator/operator.sh"
10-
permissions: "0700"
11-
encoding: "gzip+base64"
12-
content: |
13-
${operator_sh_content}
7+
packages:
8+
- python3-oci-cli
9+
10+
bootcmd:
11+
- [dnf, config-manager, --enable, ol8_developer]
12+
- [uptrack-upgrade, -y]
13+
1414
runcmd:
15-
- echo "Configuring operator..."
16-
- bash /root/operator/operator.sh
15+
- echo "Setting instance_principal..."
1716
- echo "export OCI_CLI_AUTH=instance_principal" >> /home/opc/.bashrc
18-
- touch /home/opc/operator.finish
17+
- touch /home/opc/operator.finish
18+
19+
final_message: |
20+
cloud-init has finished
21+
version: $version
22+
timestamp: $timestamp
23+
datasource: $datasource
24+
uptime: $uptime

datasources.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ data "cloudinit_config" "operator" {
4242
content_type = "text/cloud-config"
4343
content = templatefile(
4444
local.operator_template, {
45-
operator_sh_content = local.operator_script_template,
4645
operator_timezone = var.operator_timezone,
4746
upgrade_operator = var.upgrade_operator,
4847
}

locals.tf

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,6 @@ locals {
1616
operator_subnet = cidrsubnet(local.vcn_cidr, var.newbits, var.netnum)
1717
operator_template = "${path.module}/cloudinit/operator.template.yaml"
1818

19-
operator_script_template = base64gzip(
20-
templatefile("${path.module}/scripts/operator.template.sh",
21-
{
22-
ol = var.operator_os_version
23-
}
24-
)
25-
)
26-
2719
osn = lookup(data.oci_core_services.all_oci_services.services[0], "cidr_block")
2820

2921
ssh_port = 22

scripts/operator.template.sh

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

0 commit comments

Comments
 (0)