ansible-debops-infrastructure

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

commit 5baded40485c5103d11cf69564631f425cbebfb0
parent 81763d3b9e16d62692cf05ccbdf1b969d9a7c994
Author: Dionysis Grigoropoulos <dgrig@erethon.com>
Date:   Fri, 18 Jan 2019 00:57:35 +0200

terraform: Init TF dir, setup VM disks and network

Diffstat:
terraform/infrastructure/main.tf | 25+++++++++++++++++++++++++
terraform/infrastructure/variables.tf | 14++++++++++++++
2 files changed, 39 insertions(+), 0 deletions(-)

diff --git a/terraform/infrastructure/main.tf b/terraform/infrastructure/main.tf @@ -0,0 +1,25 @@ +provider "libvirt" { + uri = "${var.libvirt_uri}" +} + +resource "libvirt_volume" "debian_dev" { + name = "debian_dev" + pool = "${var.libvirt_storage_pool}" + format = "qcow2" + size = 10737418240 +} + +resource "libvirt_volume" "obsd_dev" { + name = "obsd_dev" + pool = "${var.libvirt_storage_pool}" + format = "qcow2" + size = 10737418240 +} + +resource "libvirt_network" "dev_network" { + name = "dev_network" + mode = "nat" + addresses = "${var.libvirt_cidr}" + autostart = true + bridge = "virbr1" +} diff --git a/terraform/infrastructure/variables.tf b/terraform/infrastructure/variables.tf @@ -0,0 +1,14 @@ +variable "libvirt_uri" { + description = "URI for libvirt to use" + default = "qemu+ssh://user@host/system" +} + +variable "libvirt_storage_pool" { + description = "Storage pool to use for VM disks" + default = "tf_pool" +} + +variable "libvirt_cidr" { + description = "Network CIDR to use for VMs" + default = ["192.168.199.0/24"] +}