Skip to content

Latest commit

 

History

History
86 lines (72 loc) · 4.15 KB

File metadata and controls

86 lines (72 loc) · 4.15 KB

Terraform Module: terraform-libvirt-network

Description

This Terraform module sets up a libvirt network with customizable configurations.

Variables

Variable Name Description Required Default Value
network_autostart Whether to autostart the libvirt network true
network_name Name of the libvirt network ✔️
network_mode Mode of the libvirt network nat
network_domain Domain of the libvirt network ✔️
network_cidr CIDR for the libvirt network ["192.168.122.0/24"]
network_bridge Bridge for the libvirt network
network_mtu MTU for the libvirt network 1500
network_dns_enabled Whether DNS is enabled for the libvirt network false
network_dns_local Whether DNS is local-only for the libvirt network false
network_dhcp_enabled Whether DHCP is enabled for the libvirt network false
network_dhcp_range_start DHCP Range start for given address
network_dhcp_range_end DHCP Range end for given address
network_dns_entries Map of DNS entries for the libvirt network {}
network_routes Map of routes for the libvirt network {}
network_dns_srv_records List of SRV records for the libvirt network []

Not yet avaiable:

Variable Name Description Required Default Value
network_dnsmasq_options Map of dnsmasq options for the libvirt network []

Example invocation

module "libvirt_network" {
  source                         = "kubealex/libvirt-resources/libvirt//modules/terraform-libvirt-network"
# version                        = "0.1.3" # Uncomment only if you are using the version 0.8.x of the provider

  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_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 = {
    "example"                    = "192.168.122.2"
  }

  network_routes = {
    "10.0.0.0/24"                = "10.0.0.1"
  }

  network_dns_srv_records = [
    {
      service                     = "_http"
      protocol                    = "_tcp"
      domain                      = "example.com"
      target                      = "server1.example.com"
      port                        = 80
      priority                    = 10
      weight                      = 5
    },
    {
      service                     = "_ldap"
      protocol                    = "_tcp"
      domain                      = "example.com"
      target                      = "server2.example.com"
      port                        = 389
      priority                    = 20
      weight                      = 10
    }
  ]
}