Skip to content

Commit

Permalink
Homework 8.fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Vasiliy Motchenko committed Nov 16, 2023
1 parent 7791159 commit 1564070
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ansible/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ def main():
}
}

try:
os.chdir("../terraform/stage")
output = subprocess.check_output(["terraform", "output", "-json"]).decode()
output_dict = json.loads(output)

os.chdir("../terraform/stage")
output = subprocess.check_output(["terraform", "output", "-json"]).decode()
output_dict = json.loads(output)
try:
data["app"]["hosts"].append(output_dict["external_ip_address_app"]["value"])
data["db"]["hosts"].append(output_dict["external_ip_address_db"]["value"])

Expand Down

0 comments on commit 1564070

Please sign in to comment.