Skip to content

Commit

Permalink
fix: ansible inventory bungling caused by yaml formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Ric Featherstone authored and 06kellyjac committed Dec 21, 2023
1 parent 127c16a commit 3146add
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion terraform/modules/cluster/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ locals {
ansible_config = templatefile("${path.module}/templates/ansible.cfg", {
ssh_config_filename = var.ssh_config_filename
})
ansible_inventory = templatefile("${path.module}/templates/inventory.yaml", {
ansible_inventory = templatefile("${path.module}/templates/inventory.yaml.tpl", {
ansible_inventory_instances = local.ansible_inventory_instances
})
}
17 changes: 0 additions & 17 deletions terraform/modules/cluster/templates/inventory.yaml

This file was deleted.

17 changes: 17 additions & 0 deletions terraform/modules/cluster/templates/inventory.yaml.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
all:
children:
ungrouped:
%{ for group in keys(ansible_inventory_instances) ~}
${group}:
%{ endfor ~}
ungrouped:
hosts:
bastion:
%{ for group in keys(ansible_inventory_instances) ~}
${group}:
hosts:
%{ for host in ansible_inventory_instances[group] ~}
${host}:
%{ endfor ~}
%{ endfor ~}

0 comments on commit 3146add

Please sign in to comment.