diff --git a/contrib/terraform/aws/create-infrastructure.tf b/contrib/terraform/aws/create-infrastructure.tf index a58bca53c..f1f1e205b 100644 --- a/contrib/terraform/aws/create-infrastructure.tf +++ b/contrib/terraform/aws/create-infrastructure.tf @@ -162,7 +162,7 @@ resource "aws_instance" "k8s-worker" { */ data "template_file" "inventory" { template = "${file("${path.module}/templates/inventory.tpl")}" - + vars { public_ip_address_bastion = "${join("\n",formatlist("bastion ansible_ssh_host=%s" , aws_instance.bastion-server.*.public_ip))}" connection_strings_master = "${join("\n",formatlist("%s ansible_ssh_host=%s",aws_instance.k8s-master.*.tags.Name, aws_instance.k8s-master.*.private_ip))}" @@ -176,6 +176,7 @@ data "template_file" "inventory" { kube_insecure_apiserver_address = "kube_apiserver_insecure_bind_address: ${var.kube_insecure_apiserver_address}" } + } resource "null_resource" "inventories" { @@ -183,4 +184,8 @@ resource "null_resource" "inventories" { command = "echo '${data.template_file.inventory.rendered}' > ../../../inventory/hosts" } + triggers { + template = "${data.template_file.inventory.rendered}" + } + }