Add dns restart service

This commit is contained in:
2025-05-11 08:41:23 +10:00
parent e6e905d421
commit 7c06fba4d7
2 changed files with 28 additions and 0 deletions
+9
View File
@@ -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 {} \;
+19
View File
@@ -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