ansible-debops-infrastructure

DebOps and Ansible scripts to manage my infrastructure
git clone git://git.erethon.com/ansible-debops-infrastructure
Log | Files | Refs

commit b5eff53fb79b6f61220de3c39de292c9ff1adaa8
parent e57a631ae9824fb24dddf4161de7ed2d47af00ea
Author: Dionysis Grigoropoulos <dgrig@erethon.com>
Date:   Sun, 29 Sep 2019 19:23:27 +0300

terraform: Add module for libvirt networks

Diffstat:
terraform/infrastructure/modules/libvirt_network/main.tf | 7+++++++
terraform/infrastructure/modules/libvirt_network/outputs.tf | 7+++++++
terraform/infrastructure/modules/libvirt_network/vars.tf | 21+++++++++++++++++++++
3 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/terraform/infrastructure/modules/libvirt_network/main.tf b/terraform/infrastructure/modules/libvirt_network/main.tf @@ -0,0 +1,7 @@ +resource "libvirt_network" "network" { + name = "${var.network_name}" + mode = "${var.network_mode}" + addresses = ["${var.network_cidr}"] + autostart = "${var.network_autostart}" + bridge = "${var.network_bridge_interface}" +} diff --git a/terraform/infrastructure/modules/libvirt_network/outputs.tf b/terraform/infrastructure/modules/libvirt_network/outputs.tf @@ -0,0 +1,7 @@ +output cidr { + value = "${var.network_cidr}" +} + +output id { + value = libvirt_network.network.id +} diff --git a/terraform/infrastructure/modules/libvirt_network/vars.tf b/terraform/infrastructure/modules/libvirt_network/vars.tf @@ -0,0 +1,21 @@ +variable "network_name" { + type = string +} + +variable "network_mode" { + type = string + default = "nat" +} + +variable "network_cidr" { + type = string +} + +variable "network_autostart" { + type = bool + default = true +} + +variable "network_bridge_interface" { + type = string +}