From 5eb39daf95f4f4c7b247cb5a37e4267eb6c4b15e Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Thu, 14 Mar 2024 20:52:25 +0100 Subject: [PATCH] chore: use opentofu and replace restapi provider (#4) Reviewed-on: https://gitea.rknet.org/infra/hcloud-server-tf/pulls/4 Co-authored-by: Robert Kaussow Co-committed-by: Robert Kaussow --- .woodpecker/test.yml | 8 ++++---- main.tf | 2 +- versions.tf | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.woodpecker/test.yml b/.woodpecker/test.yml index c3c4d6b..9ca203d 100644 --- a/.woodpecker/test.yml +++ b/.woodpecker/test.yml @@ -16,9 +16,9 @@ steps: commands: - tflint --color - - name: terraform - image: docker.io/jmccann/drone-terraform:8 + - name: tofu + image: quay.io/thegeeklab/wp-opentofu settings: - actions: + action: - validate - tf_version: 1.5.0 + tofu_version: 1.6.1 diff --git a/main.tf b/main.tf index fa48f1f..7c52095 100644 --- a/main.tf +++ b/main.tf @@ -151,7 +151,7 @@ resource "restapi_object" "ucs_server" { "name" : each.value.name, "a" : [ hcloud_server.server[each.value.name].ipv4_address, - hcloud_server.server[each.value.name].ipv6_address, + try(each.value.ucs_ipv6_address, hcloud_server.server[each.value.name].ipv6_address), ], } }) diff --git a/versions.tf b/versions.tf index ff6f93c..525cc5d 100644 --- a/versions.tf +++ b/versions.tf @@ -1,13 +1,13 @@ terraform { required_providers { cloudflare = { - source = "cloudflare/cloudflare" + source = "registry.opentofu.org/cloudflare/cloudflare" } hcloud = { - source = "hetznercloud/hcloud" + source = "registry.opentofu.org/hetznercloud/hcloud" } restapi = { - source = "Mastercard/restapi" + source = "registry.opentofu.org/thegeeklab/restapi" } } }