This commit is contained in:
parent
2eb472cc20
commit
043a1b6ffa
5 changed files with 111 additions and 26 deletions
49
provision/local/main.tf
Normal file
49
provision/local/main.tf
Normal file
|
@ -0,0 +1,49 @@
|
|||
terraform {
|
||||
required_providers {
|
||||
libvirt = {
|
||||
source = "dmacvicar/libvirt"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
provider "libvirt" {
|
||||
uri = "qemu:///system"
|
||||
}
|
||||
|
||||
resource "libvirt_volume" "win11-ltsc-cloudbase-init" {
|
||||
name = "win11-ltsc-cloudbase-init.qcow2"
|
||||
pool = "default" # List storage pools using virsh pool-list
|
||||
source = "win11-ltsc-original.qcow2"
|
||||
format = "qcow2"
|
||||
}
|
||||
|
||||
resource "libvirt_domain" "win11-ltsc-cloudbase-init" {
|
||||
name = "win11-ltsc-cloudbase-init"
|
||||
memory = "8192"
|
||||
vcpu = 4
|
||||
|
||||
network_interface {
|
||||
network_name = "default" # List networks with virsh net-list
|
||||
}
|
||||
|
||||
disk {
|
||||
volume_id = "${libvirt_volume.win11-ltsc-cloudbase-init.id}"
|
||||
}
|
||||
|
||||
console {
|
||||
type = "pty"
|
||||
target_type = "serial"
|
||||
target_port = "0"
|
||||
}
|
||||
|
||||
graphics {
|
||||
type = "spice"
|
||||
listen_type = "address"
|
||||
autoport = true
|
||||
}
|
||||
}
|
||||
|
||||
# Output Server IP
|
||||
output "ip" {
|
||||
value = "${libvirt_domain.centos7.network_interface.0.addresses.0}"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue