#--- Importing module with VM creation ---
data "template_file" "client_config" {
template = "${file("${path.module}/config/cloudconfig.yml.tpl")}"
}
module "servers" {
source = "./servers"
name = "swarm"
vm_size = "${var.vm_size}"
image_sku = "${var.image_sku}"
image_offer = "${var.image_offer}"
image_publisher = "${var.image_publisher}"
location = "${var.location}"
resource_group_name = "${
azurerm_resource_group.common.name}"
username = "${var.username}"
pwd = "${random_string.password.result}"
ssh_key = "${var.ssh_key}"
ssh_port = "${var.ssh_port}"
availability_set_id = "${
azurerm_availability_set.common.id}"
subnet_id = "${
azurerm_subnet.common.id}"
storage_type = "${var.storage_type}"
tags = "${local.tags}"
cloud_config = "${base64encode(data.template_file.client_config.rendered)}"
}