-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from kubealex/add-dhcp-ranges
add dhcp range and fix dns variables naming
- Loading branch information
Showing
5 changed files
with
75 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,24 @@ | ||
module "libvirt_network" { | ||
source = "kubealex/libvirt-resources/libvirt//modules/terraform-libvirt-pool" | ||
version = "0.0.1" | ||
network_autostart = true | ||
network_autostart = true | ||
network_name = "example_network" | ||
network_mode = "nat" | ||
network_domain = "example.com" | ||
network_cidr = ["192.168.122.0/24"] | ||
network_bridge = "br0" | ||
network_mtu = 1500 | ||
network_dhcp_enabled = true | ||
network_dhcp_local = false | ||
network_dnsmasq_options = { | ||
network_mode = "nat" | ||
network_domain = "example.com" | ||
network_cidr = ["192.168.122.0/24"] | ||
network_bridge = "br0" | ||
network_mtu = 1500 | ||
network_dns_enabled = true | ||
network_dns_local = false | ||
network_dhcp_enabled = true | ||
network_dhcp_range_start = "192.168.122.15" | ||
network_dhcp_range_end = "192.168.122.50" | ||
network_dnsmasq_options = { | ||
"server" = "/example.com/192.168.122.1" | ||
} | ||
network_dns_entries = { | ||
network_dns_entries = { | ||
"example" = "192.168.122.2" | ||
} | ||
network_routes = { | ||
network_routes = { | ||
"10.0.0.0/24" = "10.0.0.1" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
modules/terraform-libvirt-network/templates/dhcp-range-patch.xslt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?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="/network/ip/dhcp/range"> | ||
<xsl:copy> | ||
<xsl:attribute name="start">${network_dhcp_range_start}</xsl:attribute> | ||
<xsl:attribute name="end">${network_dhcp_range_end}</xsl:attribute> | ||
<xsl:apply-templates select="@*[not(local-name()='end') and not(local-name()='start')]|node()"/> | ||
</xsl:copy> | ||
</xsl:template> | ||
</xsl:stylesheet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters