try:
print(f"OS according to facts: {data['os']['value']['name']} {data['os']['value']['release']['full']}\n")
- # Nameservers resolv.conf
- for ns in data["resolv_conf"]["value"]["nameserver"]:
- sample_pre_tf["defaults"]["namservers"].append(ns)
-
- # Searchdomains resolv.conf
- for sd in data["resolv_conf"]["value"]["search"]:
- sample_pre_tf["defaults"]["searchdomains"].append(sd)
-
# Options resolv.conf
try:
timeout = data["resolv_conf"]["value"]["timeout"]
attempts = data["resolv_conf"]["value"]["attempts"]
+
+ # Nameservers resolv.conf
+ for ns in data["resolv_conf"]["value"]["nameserver"]:
+ sample_pre_tf["defaults"]["namservers"].append(ns)
+
+ # Searchdomains resolv.conf
+ for sd in data["resolv_conf"]["value"]["search"]:
+ sample_pre_tf["defaults"]["searchdomains"].append(sd)
except:
timeout = 1
attempts = 2
+ sample_pre_tf["defaults"]["namservers"] = []
+ sample_pre_tf["defaults"]["searchdomains"] = []
sample_pre_tf["defaults"]["dns_options"] = f"timeout: {timeout} attempts: {attempts}"
# Project
sample_pre_tf["defaults"]["puppet"]["project"] = data["pp_owner"]["value"]
- # Project
- sample_pre_tf["defaults"]["purpose"] = data["pp_purpose"]["value"]
+ # Purpose
+ sample_pre_tf["defaults"]["purpose"] = data["pp_purpose"]["value"].split(' ')[0]
# Environment
sample_pre_tf["defaults"]["puppet"]["tier"] = data["tier"]["value"]