-
Hi, How do I get the ip address of eth0 from creating a vm to call ansible with the -i option as a local-exec? Thanks |
Beta Was this translation helpful? Give feedback.
Answered by
bpg
Apr 17, 2023
Replies: 1 comment 1 reply
-
Hey @clumbo! 👋🏼 If you take an example from #211 (comment) and add something like output "vm_ip" {
value = proxmox_virtual_environment_vm.ubuntu_vm.ipv4_addresses[1]
} Then it will print out IP(s) of
( It worth to mention that you'd need to have Alternatively you can use a static IP with the VM. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
clumbo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey @clumbo! 👋🏼
If you take an example from #211 (comment) and add something like
Then it will print out IP(s) of
eth0
(
ipv4_addresses[0]
is alo
interface)It worth to mention that you'd need to have
qemu-guest-agent
installed on your VM and enabled in the template in order to let PVE read the network configuration of the VM.Alternatively you can use a static IP with the VM.