From a8ab4c0facd1aff1f775c695740d262809fe37f0 Mon Sep 17 00:00:00 2001 From: Veselin Bochev Date: Thu, 2 Jun 2022 15:09:26 +0300 Subject: [PATCH] fix the environment detection from r10k pp facts --- bin/pre-terraform | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/pre-terraform b/bin/pre-terraform index 9a6e2e8..46eced4 100755 --- a/bin/pre-terraform +++ b/bin/pre-terraform @@ -87,7 +87,8 @@ fields = [ "tier", "pp_ip_cidr", "ipaddress", - "pp_purpose" + "pp_purpose", + "r10k_environment" ] data = {} @@ -210,7 +211,7 @@ try: # Environment sample_pre_tf["defaults"]["puppet"]["tier"] = data["tier"]["value"] - sample_pre_tf["defaults"]["puppet"]["environment"] = data["tier"]["value"] + sample_pre_tf["defaults"]["puppet"]["environment"] = data["r10k_environment"]["value"] except Exception as e: print("ERROR: Failed parsing required fields from output. Please check if hostname is in PuppetDB") # print(f"ERROR: {e}") -- 2.39.5