feat: print IP address of provisioned VMs

This commit is contained in:
Aravinth Manivannan 2022-10-24 15:37:23 +05:30
parent 55ce464567
commit ba02ec619c
Signed by: realaravinth
GPG Key ID: AD9F0F08E855ED88
1 changed files with 10 additions and 0 deletions

View File

@ -66,6 +66,7 @@ resource "libvirt_domain" "domain-ubuntu" {
network_interface {
network_name = "default"
wait_for_lease = true
}
# IMPORTANT: this is a known bug on cloud images, since they expect a console
@ -104,6 +105,7 @@ resource "libvirt_domain" "domain-debian-ansible-playground" {
network_interface {
network_name = "default"
wait_for_lease = true
}
# IMPORTANT: this is a known bug on cloud images, since they expect a console
@ -135,3 +137,11 @@ resource "libvirt_domain" "domain-debian-ansible-playground" {
# IPs: use wait_for_lease true or after creation use terraform refresh and terraform show for the ips of domain
output "ubuntu_ip" {
value = length(libvirt_domain.domain-ubuntu.network_interface[0].addresses) > 0 ? libvirt_domain.domain-ubuntu.network_interface[0].addresses[0] : ""
}
output "debian_ip" {
value = length(libvirt_domain.domain-debian-ansible-playground.network_interface[0].addresses) > 0 ? libvirt_domain.domain-debian-ansible-playground.network_interface[0].addresses[0] : ""
}