Simple terraform+ansible configuration to quickly spin up a development Docker swarm on my homeserver
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 

22 lines
598 B

data "template_file" "user_data" {
count = var.node_count
template = file("${path.module}/files/user_data.cfg")
vars = {
pubkey = file("~/.ssh/id_rsa.pub")
}
}
data "template_file" "meta_data" {
count = var.node_count
template = file("${path.module}/files/meta_data.cfg")
vars = {
hostname = "swarm-${count.index + 1}"
}
}
resource "libvirt_cloudinit_disk" "cidata" {
count = var.node_count
name = "swarm-${count.index + 1}-cidata.iso"
user_data = data.template_file.user_data[count.index].rendered
meta_data = data.template_file.meta_data[count.index].rendered
}