mirror of
https://github.com/kittywitch/nixfiles.git
synced 2026-02-09 12:29:19 -08:00
feat(oci): attempt to make servers provisioned
This commit is contained in:
parent
0505f506d2
commit
e5b2f39e99
6 changed files with 71 additions and 18 deletions
|
|
@ -1,3 +1,9 @@
|
|||
locals {
|
||||
takeover_oracle = yamlencode({
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
data "oci_core_images" "that" {
|
||||
compartment_id = var.tenancy_ocid
|
||||
|
||||
|
|
@ -10,20 +16,28 @@ data "oci_core_images" "that" {
|
|||
|
||||
data "cloudinit_config" "that" {
|
||||
part {
|
||||
content = file("user-data-that.yaml")
|
||||
content = local.takeover_oracle
|
||||
}
|
||||
}
|
||||
|
||||
variable "flex_display_name" {
|
||||
type = string
|
||||
}
|
||||
|
||||
locals {
|
||||
flex_hostname = lower(var.flex_display_name)
|
||||
}
|
||||
|
||||
resource "oci_core_instance" "that" {
|
||||
availability_domain = data.oci_identity_availability_domains.this.availability_domains.0.name
|
||||
compartment_id = var.tenancy_ocid
|
||||
shape = local.shapes.flex
|
||||
|
||||
display_name = "Oracle Linux"
|
||||
display_name = var.flex_display_name
|
||||
preserve_boot_volume = false
|
||||
|
||||
metadata = {
|
||||
ssh_authorized_keys = var.ssh_public_key
|
||||
ssh_authorized_keys = var.ssh_authorized_keys
|
||||
user_data = data.cloudinit_config.that.rendered
|
||||
}
|
||||
|
||||
|
|
@ -39,10 +53,10 @@ resource "oci_core_instance" "that" {
|
|||
|
||||
create_vnic_details {
|
||||
assign_public_ip = true
|
||||
display_name = "Oracle Linux"
|
||||
hostname_label = "oracle-linux"
|
||||
nsg_ids = [oci_core_network_security_group.this.id]
|
||||
subnet_id = oci_core_subnet.this.id
|
||||
display_name = var.flex_display_name
|
||||
hostname_label = local.flex_hostname
|
||||
nsg_ids = [var.nsg_id]
|
||||
subnet_id = var.subnet_id
|
||||
}
|
||||
|
||||
shape_config {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue