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