Closed magsoftware closed 4 years ago
Is it possible to define DHCP range in network resource ?
resource "libvirt_network" "kube_network" { name = "k8s-net" mode = "nat" addresses = [ "10.0.1.0/24" ] dhcp { enabled = true } dns { enabled = true local_only = true } }
Somethin that will give eg:
<dhcp> <range start='10.0.1.100' end='10.0.1.254'/> </dhcp>
@magsoftware hi. afaik we don't have it implemented upstream, unless i'm wrong.
but with the xslt feature you add it,
xslt
https://github.com/dmacvicar/terraform-provider-libvirt/blob/50a5506f6b29518f64ca74a9f22cd245be0c1fee/website/docs/r/network.markdown#altering-libvirts-generated-network-xml-definition
see : https://github.com/dmacvicar/terraform-provider-libvirt/blob/19c23424ccfdecf6dfcbdd87783bf835ba5f585e/examples/v0.12/xslt/main.tf#L5
other examples:
https://github.com/SUSE/ha-sap-terraform-deployments/blob/0ed22a718e76fac577eb5749de9a71fe5d9ad4e1/libvirt/modules/shared_disk/main.tf#L7
https://github.com/SUSE/ha-sap-terraform-deployments/blob/dc58fb1c0a702903aa66808f1b44d5fba2023a62/libvirt/modules/shared_disk/raw.xsl
Thanks. I did it with ansible. xslt is worse than assembler ;-)
OK closing. thx!
Is it possible to define DHCP range in network resource ?
Somethin that will give eg: