diff --git a/lb.tf b/lb.tf index 0b4cd57..4cc94b7 100644 --- a/lb.tf +++ b/lb.tf @@ -39,6 +39,7 @@ resource "libvirt_domain" "lb" { memory = var.lb_memory_size cloudinit = libvirt_cloudinit_disk.lb_cloudinit.id autostart = false + qemu_agent = true cpu = { mode = "host-passthrough" @@ -58,12 +59,20 @@ resource "libvirt_domain" "lb" { network_id = libvirt_network.ocp_net.id addresses = [cidrhost(var.network_ip_range, 4)] hostname = "lb" - wait_for_lease = false + + # When creating the domain resource, wait until the network interface gets + # a DHCP lease from libvirt, so that the computed IP addresses will be + # available when the domain is up and the plan applied. + wait_for_lease = true } network_interface { bridge = var.external_ifname mac = var.external_mac_address - wait_for_lease = false + + # When creating the domain resource, wait until the network interface gets + # a DHCP lease from libvirt, so that the computed IP addresses will be + # available when the domain is up and the plan applied. + wait_for_lease = true } } diff --git a/main.tf b/main.tf index 11a98e3..d5dd241 100644 --- a/main.tf +++ b/main.tf @@ -28,7 +28,7 @@ locals { master_nodes = { for i in libvirt_domain.master : i.name => i.network_interface.0.addresses[0] } worker_nodes = { for i in libvirt_domain.worker : i.name => i.network_interface.0.addresses[0] } bootstrap_nodes = { for i in libvirt_domain.bootstrap : i.name => i.network_interface.0.addresses[0] } - additional_nodes = { (libvirt_domain.lb.name) = cidrhost(var.network_ip_range, 4), (libvirt_domain.storage.name) = libvirt_domain.storage.network_interface.0.addresses[0] } + additional_nodes = { (libvirt_domain.lb.name) = [ libvirt_domain.storage.network_interface.0.addresses[0], libvirt_domain.storage.network_interface.1.addresses[0] ], (libvirt_domain.storage.name) = libvirt_domain.storage.network_interface.0.addresses[0] } all_nodes = merge(local.additional_nodes, local.master_nodes, local.worker_nodes, local.bootstrap_nodes) } diff --git a/storage.tf b/storage.tf index edbadd0..9581fe2 100644 --- a/storage.tf +++ b/storage.tf @@ -33,6 +33,7 @@ resource "libvirt_domain" "storage" { memory = var.storage_memory_size cloudinit = libvirt_cloudinit_disk.storage_cloudinit.id autostart = false + qemu_agent = true cpu = { mode = "host-passthrough"