From 63aa3a721602d9bbaf4cbdd19f6b410fb5e7685c Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Fri, 21 Feb 2020 21:51:16 +0000 Subject: [PATCH] Drive part of ansible context from terraform --- ansible/group_vars/all/hosts.yml | 4 ++-- terraform/context.tf | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 terraform/context.tf diff --git a/ansible/group_vars/all/hosts.yml b/ansible/group_vars/all/hosts.yml index aa21c63..f0765ed 100644 --- a/ansible/group_vars/all/hosts.yml +++ b/ansible/group_vars/all/hosts.yml @@ -1,2 +1,2 @@ -hosts: - casey_ip: 108.61.221.88 +"hosts": + "casey_ip": "108.61.221.88" diff --git a/terraform/context.tf b/terraform/context.tf new file mode 100644 index 0000000..b827652 --- /dev/null +++ b/terraform/context.tf @@ -0,0 +1,8 @@ +resource "local_file" "hosts" { + content = yamlencode({ + hosts: { + casey_ip: vultr_server.casey.main_ip + } + }) + filename = "${path.module}/../ansible/group_vars/all/hosts.yml" +}