diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2021-01-09 12:33:17 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2021-01-09 12:33:17 +0100 |
commit | 16795884f3e915ed6d8b086fd5b6b93fc4858a27 (patch) | |
tree | 2043154f60fd396e5ee9f572df0dc9112f46feff /ansible/terraform-to-ansible-inventory.py | |
parent | 4dd314376968d99abe67e1c49ad8032d3a2b96c2 (diff) | |
parent | 5b1279c3dd28a2c0252624c36e937c59db15270d (diff) | |
download | infra-16795884f3e915ed6d8b086fd5b6b93fc4858a27.tar.gz infra-16795884f3e915ed6d8b086fd5b6b93fc4858a27.tar.bz2 infra-16795884f3e915ed6d8b086fd5b6b93fc4858a27.tar.xz infra-16795884f3e915ed6d8b086fd5b6b93fc4858a27.zip |
Merge branch 'master' of trygvis.io:git/infra
Diffstat (limited to 'ansible/terraform-to-ansible-inventory.py')
-rw-r--r-- | ansible/terraform-to-ansible-inventory.py | 13 |
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) |