Hi,
Does anyone knows how to set the operating system info for a libvirt/kvm VM using XSLT ?
xml example on an existing VM created with virt-manager:
<metadata>
<libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
<libosinfo:os id="http://redhat.com/rhel/9.0"/>
</libosinfo:libosinfo>
</metadata>
XSLT:
<?xml version="1.0" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes" indent="yes"/>
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="/domain">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
<xsl:element name ="metadata">
<xsl:element name ="libosinfo:libosinfo">
<xsl:attribute name="xmlns:libosinfo">"http://libosinfo.org/xmlns/libvirt/domain/1.0"</xsl:attribute>
<xsl:element name ="libosinfo:os">
<xsl:attribute name="id">"http://redhat.com/rhel/9.0"</xsl:attribute>
</xsl:element>
</xsl:element>
</xsl:element>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
Error i’m getting:
libvirt_domain.PROV-TST: Creating…
╷
│ Error: error applying XSLT stylesheet: exit status 5
│
terraform: 1.3.4
libvirt provider: dmacvicar/libvirt/0.7.0