Add dynamic ansible inventory from terraform state
This commit is contained in:
parent
bccc07f806
commit
70578f2a13
11 changed files with 84 additions and 51 deletions
|
@ -102,9 +102,9 @@ if __name__ == '__main__':
|
|||
services = {}
|
||||
|
||||
with open('./hosts.auto.tfvars', 'r') as file:
|
||||
hosts = hcl2.load(file)["hosts"][0]
|
||||
hosts = hcl2.load(file)["hosts"]
|
||||
with open('./services.auto.tfvars', 'r') as file:
|
||||
services = hcl2.load(file)["services"][0]
|
||||
services = hcl2.load(file)["services"]
|
||||
|
||||
keys = {}
|
||||
keys["db_key"] = service_key_find("postgresql", services, hosts)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue