From f916e715e50f01f191ce599172b5fc6456da0173 Mon Sep 17 00:00:00 2001 From: Vojtech Mares Date: Sat, 23 Nov 2024 09:29:55 +0100 Subject: [PATCH] refactor: use standalone hcloud_primary_ip resource for control plane node ip --- CHANGELOG.md | 6 ++++++ machines.tf | 20 ++++++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 74f95b4..3abaed0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [0.6.0] - 2024-11-23 + +### Changed + +- Use standalone resource for control plane primary IP + ## [0.5.0] - 2024-11-20 ### Added diff --git a/machines.tf b/machines.tf index 125c5d7..18e2676 100644 --- a/machines.tf +++ b/machines.tf @@ -1,5 +1,21 @@ +locals { + control_plane_nodes = 1 +} + +# 58639934 +resource "hcloud_primary_ip" "cthulhu_control_plane" { + count = local.control_plane_nodes + + name = "control-plane-${count.index}" + type = "ipv4" + assignee_type = "server" + assignee_id = hcloud_server.cthulhu_control_plane[count.index].id + auto_delete = false + delete_protection = true +} + resource "hcloud_server" "cthulhu_control_plane" { - count = 1 + count = local.control_plane_nodes name = "control-plane-${count.index}" image = "rocky-9" @@ -26,7 +42,7 @@ resource "hcloud_server" "cthulhu_control_plane" { public_net { ipv4_enabled = true - ipv6_enabled = true + ipv6_enabled = false } network {