Commit e01ba68a authored by Alex Hanselka's avatar Alex Hanselka
Browse files

fix: deal with deprecation notices

parent 78929112
Pipeline #4243 passed with stage
in 3 minutes and 43 seconds
......@@ -6,7 +6,7 @@ data "template_file" "init" {
template = "${file("${path.module}/data/cloud-init.tpl")}"
vars = {
server_hostname = "${var.node_name}"
server_hostname = var.node_name
}
}
......@@ -18,7 +18,7 @@ data "template_cloudinit_config" "config" {
part {
filename = "init.cfg"
content_type = "text/cloud-config"
content = "${data.template_file.init.rendered}"
content = data.template_file.init.rendered
}
}
......@@ -31,12 +31,12 @@ data "hcloud_ssh_key" "ahanselka" {
}
resource "hcloud_server" "generic-hcloud" {
name = "${var.node_name}"
image = "${var.image}"
server_type = "${var.type}"
location = "${var.server_location}"
ssh_keys = ["${data.hcloud_ssh_key.ansible.id}", "${data.hcloud_ssh_key.ahanselka.id}"]
user_data = "${data.template_cloudinit_config.config.rendered}"
name = var.node_name
image = var.image
server_type = var.type
location = var.server_location
ssh_keys = [data.hcloud_ssh_key.ansible.id, data.hcloud_ssh_key.ahanselka.id]
user_data = data.template_cloudinit_config.config.rendered
provisioner "local-exec" {
command = "curl -X POST -F token=${var.ansible_token} -F ref=master -F 'variables[NEW_HOST]=${var.node_name}' https://gitlab.darkdna.net/api/v4/projects/144/trigger/pipeline"
......@@ -51,25 +51,25 @@ resource "hcloud_server_network" "network" {
}
resource "hcloud_rdns" "ipv4" {
server_id = "${hcloud_server.generic-hcloud.id}"
ip_address = "${hcloud_server.generic-hcloud.ipv4_address}"
server_id = hcloud_server.generic-hcloud.id
ip_address = hcloud_server.generic-hcloud.ipv4_address
dns_ptr = "${var.node_name}.${replace(data.google_dns_managed_zone.dns-zone.dns_name, "/.$/", "")}"
}
resource "hcloud_rdns" "ipv6" {
server_id = "${hcloud_server.generic-hcloud.id}"
ip_address = "${hcloud_server.generic-hcloud.ipv6_address}"
server_id = hcloud_server.generic-hcloud.id
ip_address = hcloud_server.generic-hcloud.ipv6_address
dns_ptr = "${var.node_name}.${replace(data.google_dns_managed_zone.dns-zone.dns_name, "/.$/", "")}"
}
resource "ansible_host" "hcloud-host" {
inventory_hostname = "${hcloud_server.generic-hcloud.name}"
groups = "${concat(var.ansible_groups, var.hcloud_ansible_groups)}"
inventory_hostname = hcloud_server.generic-hcloud.name
groups = concat(var.ansible_groups, var.hcloud_ansible_groups)
vars = {
ansible_user = "root"
ansible_host = "${hcloud_server.generic-hcloud.ipv4_address}"
wireguard_address = "${var.wireguard_address}"
ansible_host = hcloud_server.generic-hcloud.ipv4_address
wireguard_address = var.wireguard_address
wireguard_endpoint = "${var.node_name}.hc.${data.google_dns_managed_zone.dns-zone.dns_name}"
}
}
......@@ -78,14 +78,14 @@ resource "google_dns_record_set" "external" {
name = "${var.node_name}.hc.${data.google_dns_managed_zone.dns-zone.dns_name}"
type = "A"
ttl = 3600
managed_zone = "${data.google_dns_managed_zone.dns-zone.name}"
rrdatas = ["${hcloud_server.generic-hcloud.ipv4_address}"]
managed_zone = data.google_dns_managed_zone.dns-zone.name
rrdatas = [hcloud_server.generic-hcloud.ipv4_address]
}
resource "google_dns_record_set" "external-v6" {
name = "${var.node_name}.hc.${data.google_dns_managed_zone.dns-zone.dns_name}"
type = "AAAA"
ttl = 3600
managed_zone = "${data.google_dns_managed_zone.dns-zone.name}"
rrdatas = ["${hcloud_server.generic-hcloud.ipv6_address}"]
managed_zone = data.google_dns_managed_zone.dns-zone.name
rrdatas = ["${hcloud_server.generic-hcloud.ipv6_address}1"]
}
output "public_ip" {
value = "${hcloud_server.generic-hcloud.ipv4_address}"
value = hcloud_server.generic-hcloud.ipv4_address
}
output "public_ipv6" {
......
......@@ -3,28 +3,28 @@ variable "image" {}
variable "type" {}
variable "server_location" {
type = "string"
type = string
default = "nbg1"
}
variable "ansible_groups" {
type = "list"
type = list
default = []
}
variable "hcloud_ansible_groups" {
type = "list"
type = list
default = ["hcloud"]
}
variable "ansible_token" {
description = "The pipeline token to trigger the ansible build"
type = "string"
type = string
}
variable "wireguard_address" {
description = "Wireguard address"
type = "string"
type = string
default = ""
}
......@@ -42,4 +42,4 @@ variable "network_ip" {
variable "network_enabled" {
default = false
}
\ No newline at end of file
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment