From 7c06fba4d7574ea942c8aa9460599f912a14910e Mon Sep 17 00:00:00 2001 From: Junwei Zhao Date: Sun, 11 May 2025 08:41:23 +1000 Subject: [PATCH] Add dns restart service --- recovery.sh | 9 +++++++++ terraform/main.tf | 19 +++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/recovery.sh b/recovery.sh index 764c0fb..da456b6 100644 --- a/recovery.sh +++ b/recovery.sh @@ -236,3 +236,12 @@ git reflog ``` git reset --hard HEAD@{1} + + +# vmware exsi complains volume is full +# There is no more space for virtual disk 'server-3-000006.vmdk'. You might be able to continue this session by freeing disk space on the relevant volume, and clicking Retry. Click Cancel to terminate this session. +# It was because virtual machine consumes space, so does the snapshot! + +# enable vmware ssh through UI and then Find large files +df -h +find /vmfs/volumes/tiplus-ssd/ -type f -size +1000000k -exec ls -lh {} \; diff --git a/terraform/main.tf b/terraform/main.tf index d9c5841..2a5bf75 100644 --- a/terraform/main.tf +++ b/terraform/main.tf @@ -65,6 +65,25 @@ resource "ssh_resource" "k3s_install" { ] } +resource "ssh_resource" "dns_fix" { + depends_on = [ssh_resource.k3s_install] + + host = local.ssh_host + user = local.ssh_user + port = local.ssh_port + private_key = local.ssh_private_key + timeout = "3m" + + when = "create" + + commands = [ + "cat << 'EOF' | sudo tee /etc/systemd/system/systemd-resolved-restart.service\n[Unit]\nDescription=Restart systemd-resolved\nAfter=network.target\n\n[Service]\nType=oneshot\nExecStart=/bin/systemctl restart systemd-resolved\n\n[Install]\nWantedBy=multi-user.target\nEOF", + "sudo systemctl enable systemd-resolved-restart.service", + "sudo systemctl start systemd-resolved-restart.service", + "echo 'DNS fix service installed and enabled'" + ] +} + output "k3s_token" { value = local.token_cmd sensitive = false