]> Frank Brehm's Git Trees - pixelpark/create-terraform.git/commitdiff
fix the environment detection from r10k pp facts
authorVeselin Bochev <veselin.bochev@WKMZT0869FF7.global.publicisgroupe.net>
Thu, 2 Jun 2022 12:09:26 +0000 (15:09 +0300)
committerVeselin Bochev <veselin.bochev@WKMZT0869FF7.global.publicisgroupe.net>
Thu, 2 Jun 2022 12:09:26 +0000 (15:09 +0300)
bin/pre-terraform

index 9a6e2e819ed7264ffb537efbc93f765deb79e994..46eced4d1331d7206ed0c3f22ca5d8788870610f 100755 (executable)
@@ -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}")