autostart VM

This commit is contained in:
Pim Kunis 2023-03-17 18:12:12 +01:00
parent 1e75ff6374
commit 76fcb3a013

15
main.tf
View file

@ -33,18 +33,19 @@ resource "libvirt_cloudinit_disk" "cloudinit" {
}
resource "libvirt_domain" "ubuntu" {
name = "hermes"
memory = 1024
vcpu = 4
name = "hermes"
memory = 1024
vcpu = 4
autostart = true
disk {
volume_id = libvirt_volume.main_disk.id
}
network_interface {
bridge = "dmzbr"
hostname = var.name
mac = "CA:FE:C0:FF:EE:07"
bridge = "dmzbr"
hostname = var.name
mac = "CA:FE:C0:FF:EE:07"
}
cloudinit = libvirt_cloudinit_disk.cloudinit.id
@ -54,7 +55,7 @@ resource "libvirt_domain" "ubuntu" {
environment = {
ANSIBLE_HOST_KEY_CHECKING = "False"
ANSIBLE_CONFIG = "${var.ansible_cfg}"
ANSIBLE_CONFIG = "${var.ansible_cfg}"
}
}