summaryrefslogtreecommitdiff
path: root/ansible/terraform-to-ansible-inventory.py
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2021-01-08 16:54:04 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2021-01-08 16:54:36 +0100
commit5b1279c3dd28a2c0252624c36e937c59db15270d (patch)
tree2a14ab954a3fac6fde17c05b5821f65c5bd4ba3b /ansible/terraform-to-ansible-inventory.py
parent9e4e02fdfb5a9e038c5e09a38fa51b457164156b (diff)
downloadinfra-5b1279c3dd28a2c0252624c36e937c59db15270d.tar.gz
infra-5b1279c3dd28a2c0252624c36e937c59db15270d.tar.bz2
infra-5b1279c3dd28a2c0252624c36e937c59db15270d.tar.xz
infra-5b1279c3dd28a2c0252624c36e937c59db15270d.zip
minio
Diffstat (limited to 'ansible/terraform-to-ansible-inventory.py')
-rw-r--r--ansible/terraform-to-ansible-inventory.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/ansible/terraform-to-ansible-inventory.py b/ansible/terraform-to-ansible-inventory.py
new file mode 100644
index 0000000..25b402b
--- /dev/null
+++ b/ansible/terraform-to-ansible-inventory.py
@@ -0,0 +1,13 @@
+from collections.abc import Iterable
+import os
+import sys
+import json
+
+j = blob = json.load(sys.stdin)
+
+new = {}
+for k, v in blob.items():
+ new[k] = v["value"]
+
+new = {"all": {"vars": new}}
+json.dump(new, fp=sys.stdout)