trying dynamic ip script

This commit is contained in:
tolerryan
2024-11-04 22:22:16 -06:00
parent 90ec6c685d
commit 9ab09c4be3
3 changed files with 6 additions and 4 deletions

View File

@@ -1,5 +1,7 @@
$!/bin/bash
until timeout 5 bash -c '</dev/tcp/192.168.0.56/22'; do
ansible-playbook --key-file "~/.ssh/setuproot.key.priv" -i 192.168.0.56, ./.ansible.d/setup.yml
ipwnet = $1
ip = ${ipwnet:0:${#ipwnet}-4}
until timeout 5 bash -c "</dev/tcp/$ip/22"; do
ansible-playbook --key-file "~/.ssh/setuproot.key.priv" -i $ip, ./.ansible.d/setup.yml
sleep 1
done

View File

@@ -39,7 +39,7 @@ resource "proxmox_lxc" "grail" {
}
provisioner "local-exec" {
command = "./.ansible.d/setup.sh"
command = "./.ansible.d/setup.sh ${network.ip}"
}
}

View File

@@ -39,7 +39,7 @@ resource "proxmox_lxc" "wikmd" {
}
provisioner "local-exec" {
command = "./.ansible.d/setup.sh"
command = "./.ansible.d/setup.sh ${network.ip}"
}
}