Compare commits

...

4 Commits

Author SHA1 Message Date
490b2279b4 Don't wait 2022-06-01 21:48:08 -05:00
ed8e4a55c4 Register hosts in Linode Managed DNS 2022-05-30 20:58:41 -05:00
3e74388f97 Default to Fedora 36 2022-05-30 20:23:23 -05:00
fb12a159a4 Version bumps 2022-05-30 19:50:10 -05:00
8 changed files with 34 additions and 4 deletions

View File

@@ -0,0 +1,3 @@
data "linode_domain" "this" {
domain = var.domain_name
}

View File

@@ -1,4 +1,3 @@
output "instance" { output "instance" {
value = linode_instance.this value = linode_instance.this
} }

View File

@@ -0,0 +1,6 @@
resource "linode_domain_record" "this_ipv4" {
domain_id = data.linode_domain.this.id
name = var.host_name
record_type = "A"
target = linode_instance.this.ip_address
}

View File

@@ -0,0 +1,6 @@
resource "linode_domain_record" "this_ipv6" {
domain_id = data.linode_domain.this.id
name = var.host_name
record_type = "AAAA"
target = element(split("/", linode_instance.this.ipv6), 0)
}

View File

@@ -0,0 +1,8 @@
resource "linode_rdns" "this_ipv4" {
address = linode_instance.this.ip_address
depends_on = [
linode_domain_record.this_ipv4,
]
rdns = "${var.host_name}.${var.domain_name}"
wait_for_available = false
}

View File

@@ -0,0 +1,8 @@
resource "linode_rdns" "this_ipv6" {
address = element(split("/", linode_instance.this.ipv6), 0)
depends_on = [
linode_domain_record.this_ipv6,
]
rdns = "${var.host_name}.${var.domain_name}"
wait_for_available = false
}

View File

@@ -2,8 +2,8 @@ terraform {
required_providers { required_providers {
linode = { linode = {
source = "linode/linode" source = "linode/linode"
version = ">= 1.27.1" version = ">= 1.27.2"
} }
} }
required_version = ">= 1.1.9" required_version = ">= 1.2.1"
} }

View File

@@ -1,4 +1,4 @@
variable "image" { variable "image" {
default = "linode/fedora35" default = "linode/fedora36"
type = string type = string
} }