-
Notifications
You must be signed in to change notification settings - Fork 1
/
locals.tf
29 lines (28 loc) · 1.95 KB
/
locals.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# ---------------------------------------------------------------------------
# Trivadis AG, Infrastructure Managed Services
# Saegereistrasse 29, 8152 Glattbrugg, Switzerland
# ---------------------------------------------------------------------------
# Name.......: locals.tf
# Author.....: Stefan Oehrli (oes) [email protected]
# Editor.....: Stefan Oehrli
# Date.......: 2020.10.12
# Revision...:
# Purpose....: Local variables for the terraform module tvdlab vcn.
# Notes......: --
# Reference..: --
# License....: Apache License Version 2.0, January 2004 as shown
# at http://www.apache.org/licenses/
# ---------------------------------------------------------------------------
locals {
availability_domain = data.oci_identity_availability_domains.ad_list.availability_domains[var.ad_index - 1].name
resource_name = var.resource_name == "" ? data.oci_identity_compartment.compartment.name : var.resource_name
resource_shortname = lower(replace(local.resource_name, "-", ""))
host_image_id = var.host_image_id == "CENTOS" || var.host_image_id == "OEL" || var.host_image_id == "WIN" ? data.oci_core_images.oracle_images.images.0.id : var.host_image_id
hosts_file = var.hosts_file == "" ? "${path.module}/etc/hosts.template" : var.hosts_file
ssh_public_key_path = var.ssh_public_key_path == "" ? "${path.module}/etc/authorized_keys.template" : var.ssh_public_key_path
ssh_authorized_keys = var.ssh_public_key != "" ? var.ssh_public_key : file(local.ssh_public_key_path)
host_bootstrap_template = var.host_os == "Windows" ? "${path.module}/cloudinit/windows_host.yaml" : "${path.module}/cloudinit/linux_host.yaml"
bootstrap_windows_host = base64gzip(file("${path.module}/scripts/bootstrap_windows_host.template.ps1"))
bootstrap_linux_host = base64gzip(file("${path.module}/scripts/bootstrap_linux_host.template.sh"))
}
# --- EOF -------------------------------------------------------------------