feat: print IP address of provisioned VMs
This commit is contained in:
parent
55ce464567
commit
ba02ec619c
1 changed files with 10 additions and 0 deletions
|
@ -66,6 +66,7 @@ resource "libvirt_domain" "domain-ubuntu" {
|
||||||
|
|
||||||
network_interface {
|
network_interface {
|
||||||
network_name = "default"
|
network_name = "default"
|
||||||
|
wait_for_lease = true
|
||||||
}
|
}
|
||||||
|
|
||||||
# IMPORTANT: this is a known bug on cloud images, since they expect a console
|
# 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_interface {
|
||||||
network_name = "default"
|
network_name = "default"
|
||||||
|
wait_for_lease = true
|
||||||
}
|
}
|
||||||
|
|
||||||
# IMPORTANT: this is a known bug on cloud images, since they expect a console
|
# 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
|
# 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] : ""
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue