Make libvirt module accept config map.

ansible-test
shnee 4 years ago
parent 9aa0a68be8
commit c9ea3d4489

@ -7,9 +7,6 @@ admin-ips = [ "8.8.8.8/32", "0.0.0.0/0" ]
disk-image-dir = "/path/to/disk/pool/"
libvirt-connection-url = "qemu+ssh://<user>@<host>/system"
master-nodes = 1
worker-nodes = 2
node-memory = 2048
node-vcpus = 2

@ -84,32 +84,19 @@ module "nodes" {
# uri = var.libvirt-connection-url
# }
#
# module "master-nodes" {
# module "nodes" {
# for_each = var.nodes-config
# source = "./modules/libvirt-nodes"
# pool-name = libvirt_pool.images.name
# name-prefix = "${var.vm-name-prefix}-master"
# num-nodes = var.master-nodes
# name-prefix = "${var.vm-name-prefix}-${each.key}"
# num-nodes = each.value.num
# node-memory = var.node-memory
# node-vcpus = var.node-vcpus
# base-image = var.base-image
# base-image = each.value.base-image
# root-admin-passwd = var.root-admin-passwd
# root-admin-pub-key = var.root-admin-pub-key
# libvirt-connection-url = var.libvirt-connection-url
# user-datas = data.template_file.master-node-user-datas
# }
#
# module "worker-nodes" {
# source = "./modules/libvirt-nodes"
# pool-name = libvirt_pool.images.name
# name-prefix = "${var.vm-name-prefix}-worker"
# num-nodes = var.worker-nodes
# node-memory = var.node-memory
# node-vcpus = var.node-vcpus
# base-image = var.base-image
# root-admin-passwd = var.root-admin-passwd
# root-admin-pub-key = var.root-admin-pub-key
# libvirt-connection-url = var.libvirt-connection-url
# user-datas = data.template_file.worker-node-user-datas
# user-datas = lookup(module.cloud-init-config, each.key, null).user-datas
# }
#
# resource "libvirt_pool" "images" {

@ -8,10 +8,6 @@ terraform {
}
}
provider "libvirt" {
uri = var.libvirt-connection-url
}
resource "libvirt_volume" "node-images" {
name = "${var.name-prefix}-${count.index}"
pool = var.pool-name

Loading…
Cancel
Save