Fixing variables
This commit is contained in:
parent
8e1424a0a2
commit
da457b3f9d
1 changed files with 6 additions and 6 deletions
|
|
@ -47,7 +47,7 @@ resource "random_id" "cluster_suffix" {
|
||||||
resource "null_resource" "talos_cluster" {
|
resource "null_resource" "talos_cluster" {
|
||||||
triggers = {
|
triggers = {
|
||||||
config_hash = sha1(join("", [
|
config_hash = sha1(join("", [
|
||||||
var.cluster_name,
|
locals.unique_cluster_name,
|
||||||
tostring(var.memory_mb),
|
tostring(var.memory_mb),
|
||||||
tostring(var.vcpu_count),
|
tostring(var.vcpu_count),
|
||||||
var.talos_version,
|
var.talos_version,
|
||||||
|
|
@ -72,12 +72,12 @@ resource "null_resource" "talos_cluster" {
|
||||||
echo "Creating new cluster..."
|
echo "Creating new cluster..."
|
||||||
sudo --preserve-env=HOME talosctl cluster create \
|
sudo --preserve-env=HOME talosctl cluster create \
|
||||||
--provisioner=qemu \
|
--provisioner=qemu \
|
||||||
--name ${self.triggers.cluster_name} \
|
--name ${locals.unique_cluster_name} \
|
||||||
--talosconfig ${path.module}/talosconfig \
|
--talosconfig ${path.module}/talosconfig \
|
||||||
--controlplanes 1 \
|
--controlplanes 1 \
|
||||||
--workers 0 \
|
--workers 0 \
|
||||||
--memory ${self.triggers.memory_mb} \
|
--memory ${var.memory_mb} \
|
||||||
--cpus ${self.triggers.vcpu_count}
|
--cpus ${var.vcpu_count}
|
||||||
|
|
||||||
# Change ownership of the generated files in ~/.talos and ~/.kube
|
# Change ownership of the generated files in ~/.talos and ~/.kube
|
||||||
sudo chown -R $(whoami):admin $(HOME)/.talos
|
sudo chown -R $(whoami):admin $(HOME)/.talos
|
||||||
|
|
@ -90,11 +90,11 @@ resource "null_resource" "talos_cluster" {
|
||||||
command = <<EOT
|
command = <<EOT
|
||||||
sudo --preserve-env=HOME talosctl cluster destroy \
|
sudo --preserve-env=HOME talosctl cluster destroy \
|
||||||
--provisioner=qemu \
|
--provisioner=qemu \
|
||||||
--name ${self.triggers.cluster_name}
|
--name ${locals.unique_cluster_name}
|
||||||
|
|
||||||
# Call cleanup script
|
# Call cleanup script
|
||||||
chmod +x ${path.module}/cleanup.sh
|
chmod +x ${path.module}/cleanup.sh
|
||||||
${path.module}/cleanup.sh ${self.triggers.cluster_name}
|
${path.module}/cleanup.sh ${locals.unique_cluster_name}
|
||||||
EOT
|
EOT
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue