Skip to content

Instantly share code, notes, and snippets.

@Craigson
Created February 3, 2021 03:57
Show Gist options
  • Save Craigson/38e548d9fb3a7e4a84acb9c3448d2faa to your computer and use it in GitHub Desktop.
Save Craigson/38e548d9fb3a7e4a84acb9c3448d2faa to your computer and use it in GitHub Desktop.
A section of the Terraform template file for creating the Ansible Inventory
[digitalocean]
%{ for index, ip in droplet_ips ~}
${droplet_names[index]} ansible_host=${ip} ansible_connection=ssh ansible_user=root subnet=172.${sort(droplet_host_numbers[index])[0]}.0.0/24 ipfs_host=172.${sort(droplet_host_numbers[index])[0]}.0.2
%{ endfor ~}
[digitalocean:vars]
agent_provider="6"
agent_tags="digitalocean"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment