Skip to content

Instantly share code, notes, and snippets.

@Craigson
Created February 3, 2021 04:07
Show Gist options
  • Save Craigson/389203b5594bed571e0c3f4f90440eda to your computer and use it in GitHub Desktop.
Save Craigson/389203b5594bed571e0c3f4f90440eda to your computer and use it in GitHub Desktop.
Main outputs.tf terraform template
resource "local_file" "ansible_inventory" {
content = templatefile("ansible_inventory.tmpl", {
ec2_tags = module.aws.tags
ec2_instance_ips = module.aws.ips
gateway_ip = module.digitalocean_cluster.droplet_gateway_address
droplet_ips = module.digitalocean_cluster.droplet_ip_addresses
droplet_host_numbers = module.digitalocean_cluster.host_numbers
droplet_names = module.digitalocean_cluster.droplet_names
gcp_metadata = module.gcp_cluster.metadata
gcp_ips = module.gcp_cluster.vm_ips
})
filename = "../ansible/inventory"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment