autostart VM
This commit is contained in:
parent
1e75ff6374
commit
76fcb3a013
1 changed files with 8 additions and 7 deletions
15
main.tf
15
main.tf
|
@ -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}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in a new issue