commit 7d4005ec66c3631fccf8f5db0d7521d8f8743348
parent 12a5721ab2c4da31fd86cfc3ee3025b293723f60
Author: Andreas Gruhler <andreas.gruhler@adfinis-sygroup.ch>
Date: Tue, 7 Apr 2020 11:14:43 +0200
add network
Diffstat:
3 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/libvirt/terraform/terraform.tfvars.example b/libvirt/terraform/terraform.tfvars.example
@@ -1,5 +1,6 @@
project = "myCluster"
hosts = ["myCluster01", "myCluster02"]
+# network = "10.66.3.0/24"
# vcpu = 1
# memory = 1024
# disk = 13
diff --git a/libvirt/terraform/variables.tf b/libvirt/terraform/variables.tf
@@ -57,4 +57,10 @@ variable "domain" {
type = string
default = ".libvirt"
description = "Domain name for the virtual network"
+}
+
+variable "network" {
+ type = string
+ default = "10.66.3.0/24"
+ description = "Subnet of the virtual network"
}
\ No newline at end of file
diff --git a/libvirt/terraform/vms.tf b/libvirt/terraform/vms.tf
@@ -126,7 +126,7 @@ resource "libvirt_network" "network" {
# list of subnets the addresses allowed for domains connected
# also derived to define the host addresses
# also derived to define the addresses served by the DHCP server
- addresses = ["10.17.3.0/24"]
+ addresses = [var.network]
# (optional) the bridge device defines the name of a bridge device
# which will be used to construct the virtual network.