[ ] Is your issue/contribution related with enabling some setting/option exposed by libvirt that the plugin does not yet support, or requires changing/extending the provider terraform schema?
[ ] Make sure you explain why this option is important to you, why it should be important to everyone. Describe your use-case with detail and provide examples where possible.
[ ] If it is a very special case, consider using the XSLT support in the provider to tweak the definition instead of opening an issue
[ ] Maintainers do not have expertise in every libvirt setting, so please, describe the feature and how it is used. Link to the appropriate documentation
[ ] Is it a bug or something that does not work as expected? Please make sure you fill the version information below:
Description of Issue/Question
Hi, I'm trying to modify volume using xslt but it seems to not work.
Setup
main.tf
terraform {
required_version = ">= 0.13"
required_providers {
libvirt = {
source = "dmacvicar/libvirt"
version = "0.6.3"
}
}
}
provider "libvirt" {
uri = "qemu+ssh://root@192.168.1.5/system"
}
resource "libvirt_pool" "ubuntu" {
name = "ubuntu"
type = "dir"
path = "/basic/libvirt/pool/ubuntu-example"
}
resource "libvirt_volume" "ubuntu-qcow2" {
name = "ubuntu-qcow2"
pool = libvirt_pool.ubuntu.name
source = "https://cloud-images.ubuntu.com/releases/xenial/release/ubuntu-16.04-server-cloudimg-amd64-disk1.img"
format = "qcow2"
xml {
xslt = templatefile("volume.xsl",
{
pool_path = "/basic/libvirt/pool/ubuntu-example",
volume = "ubuntu-qcow2"
})
}
}
data "template_file" "user_data" {
template = file("${path.module}/cloud_init.cfg")
}
data "template_file" "network_config" {
template = file("${path.module}/network_config.cfg")
}
resource "libvirt_cloudinit_disk" "commoninit" {
name = "commoninit.iso"
user_data = data.template_file.user_data.rendered
network_config = data.template_file.network_config.rendered
pool = libvirt_pool.ubuntu.name
}
resource "libvirt_domain" "domain-ubuntu" {
name = "ubuntu-terraform"
memory = "512"
vcpu = 1
cloudinit = libvirt_cloudinit_disk.commoninit.id
network_interface {
network_name = "default"
}
console {
type = "pty"
target_port = "0"
target_type = "serial"
}
console {
type = "pty"
target_type = "virtio"
target_port = "1"
}
disk {
volume_id = libvirt_volume.ubuntu-qcow2.id
}
graphics {
type = "spice"
listen_type = "address"
autoport = true
}
}
System Information
Linux distribution
Debian 10
Terraform version
Provider and libvirt versions
Checklist
[ ] Is your issue/contribution related with enabling some setting/option exposed by libvirt that the plugin does not yet support, or requires changing/extending the provider terraform schema?
[ ] Is it a bug or something that does not work as expected? Please make sure you fill the version information below:
Description of Issue/Question
Hi, I'm trying to modify volume using xslt but it seems to not work.
Setup
main.tf
volume.xsl
Steps to Reproduce Issue
Terraform apply will create domain with unmodified volumes
Additional information:
Do you have SELinux or Apparmor/Firewall enabled? Yes Some special configuration? No Have you tried to reproduce the issue without them enabled? No