aboutsummaryrefslogtreecommitdiffstats
path: root/dynamic.py
diff options
context:
space:
mode:
authorbinary <me@rgoncalves.se>2021-02-08 14:50:41 +0100
committerbinary <me@rgoncalves.se>2021-02-08 14:50:41 +0100
commit84f7b5b1ac3712c28ee60d5e5bb017e34dc1b950 (patch)
treea9273f363752d6ee8cccebb3f00590d07c68fb7a /dynamic.py
parente734362a2762a0d255ee247897909e2fa78fbc7d (diff)
downloadold-infrastructure-84f7b5b1ac3712c28ee60d5e5bb017e34dc1b950.tar.gz
Return _meta dict, but with fewer value than expected
Diffstat (limited to 'dynamic.py')
-rwxr-xr-xdynamic.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/dynamic.py b/dynamic.py
index 78ebdb2..4b5cde5 100755
--- a/dynamic.py
+++ b/dynamic.py
@@ -68,7 +68,7 @@ def get_hostvars(host):
Retrieve and build dynamic variables for a specific host.
"""
- data = host.data
+ data = {}
if "ansible_host" not in host.data:
data["ansible_host"] = host.name
return data
@@ -105,8 +105,6 @@ def get_meta(hosts):
_meta["hostvars"] = {}
for hostname, host in hosts.items():
_meta["hostvars"][hostname] = get_hostvars(host)
- # _meta["hostvars"][hostname] = host.data
- return "{}"
return _meta
@@ -133,8 +131,6 @@ def get_list(hosts, groups):
cleangr = host.data["_groups"]
cleangr = [cleangr] if isinstance(cleangr, str) else cleangr
for group in cleangr:
- # skip group assignement on non-existence!
- logging.info(f"searching for group : { group }")
if group not in groups:
logging.error(f"group { group } does not exist!")
continue
remember that computers suck.