From 5386a3d647764a02183cf17691cbd602f5c3f868 Mon Sep 17 00:00:00 2001 From: vandomej Date: Sat, 27 Sep 2025 21:19:57 -0700 Subject: [PATCH] Using templates from talos terraform provider --- main.tf | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 87aa3ed..986db6a 100644 --- a/main.tf +++ b/main.tf @@ -63,7 +63,19 @@ data "talos_machine_configuration" "controlplane" { cluster_endpoint = "https://10.5.0.2:6443" machine_type = "controlplane" machine_secrets = talos_machine_secrets.this.machine_secrets - + talos_version = "v1.11.2" +} + +data "talos_client_configuration" "this" { + cluster_name = "example-cluster" + client_configuration = talos_machine_secrets.this.client_configuration + nodes = ["10.5.0.2"] +} + +resource "talos_machine_configuration_apply" "this" { + client_configuration = talos_machine_secrets.this.client_configuration + machine_configuration_input = data.talos_machine_configuration.this.machine_configuration + node = "10.5.0.2" config_patches = [ yamlencode({ machine = { @@ -75,6 +87,22 @@ data "talos_machine_configuration" "controlplane" { ] } +resource "talos_machine_bootstrap" "this" { + depends_on = [ + talos_machine_configuration_apply.this + ] + node = "10.5.0.2" + client_configuration = talos_machine_secrets.this.client_configuration +} + +resource "talos_cluster_kubeconfig" "this" { + depends_on = [ + talos_machine_bootstrap.this + ] + client_configuration = talos_machine_secrets.this.client_configuration + node = "10.5.0.2" +} + # Download Talos kernel and initramfs resource "null_resource" "download_talos_files" { triggers = {