--- a/README.md Wed Feb 06 19:53:43 2019 -0600
+++ b/README.md Wed Feb 06 23:09:17 2019 -0600
@@ -4,6 +4,11 @@
terraform and terraform-libvirt provider
+mkisofs and libvirt are needed on the machine where terraform is running for +these plans to run properly. You need to have a `node.tfvars` in the `nodes/` directory which has contents
@@ -28,9 +33,3 @@
-mkisofs is needed on the machine where terraform is running from to be able to
--- a/instance-registry-cache.tf Wed Feb 06 19:53:43 2019 -0600
+++ b/instance-registry-cache.tf Wed Feb 06 23:09:17 2019 -0600
@@ -2,13 +2,13 @@
variable "registry_cache_memory" { default="1024" } # 1gb
variable "registry_cache_cpu" { default="1" }
-variable "admin_ssh_pubkey" {}
resource "libvirt_volume" "registry_cache" {
name = "registry-cache-root"
- base_volume_id = "${libvirt_volume.debian_base.id}"
+ base_volume_id = "${libvirt_volume.debian_base.id}" size = "${var.registry_cache_disk_size}"
+ pool = "${var.volume_pool}" data "template_file" "registry_cache_user_data" {
@@ -36,6 +36,7 @@
resource "libvirt_domain" "registry_cache" {
memory = "${var.registry_cache_memory}"
vcpu = "${var.registry_cache_cpu}"
@@ -48,22 +49,10 @@
-# target_type = "virtio"
volume_id = "${libvirt_volume.registry_cache.id}"
-# listen_type = "address"
--- a/instance-worker.tf Wed Feb 06 19:53:43 2019 -0600
+++ b/instance-worker.tf Wed Feb 06 23:09:17 2019 -0600
@@ -5,15 +5,17 @@
resource "libvirt_volume" "worker" {
count = "${var.worker_count}"
name = "worker-${count.index}-root"
base_volume_id = "${libvirt_volume.debian_base.id}"
size = "${var.worker_disk_size}"
+ pool = "${var.volume_pool}" data "template_file" "worker_user_data" {
- count = "${var.worker_count > 0 ? 1 : 0}"
+ count = "${var.worker_count > 0 ? var.worker_count : 0}" @@ -38,7 +40,7 @@
count = "${var.worker_count}"
name = "worker-${count.index}-init.iso"
- user_data = "${data.template_file.worker_user_data.rendered}"
+ user_data = "${element(data.template_file.worker_user_data.*.rendered, count.index)}" resource "libvirt_domain" "worker" {
@@ -51,28 +53,16 @@
cloudinit = "${element(libvirt_cloudinit_disk.worker.*.id, count.index)}"
-# target_type = "serial"
-# target_type = "virtio"
volume_id = "${element(libvirt_volume.worker.*.id, count.index)}"
-# listen_type = "address"
--- a/volume-base.tf Wed Feb 06 19:53:43 2019 -0600
+++ b/volume-base.tf Wed Feb 06 23:09:17 2019 -0600
@@ -1,7 +1,12 @@
+variable "volume_pool" { default = "default" } +variable "base_image_url" { default = "https://cdimage.debian.org/cdimage/openstack/9.7.0/debian-9.7.0-openstack-amd64.qcow2" } resource "libvirt_volume" "debian_base" {
- source = "https://cdimage.debian.org/cdimage/openstack/9.6.2-20181228/debian-9.6.2-20181228-openstack-amd64.qcow2"
+ pool = "${var.volume_pool}" + source = "${var.base_image_url}"