From 84f7b5b1ac3712c28ee60d5e5bb017e34dc1b950 Mon Sep 17 00:00:00 2001 From: binary Date: Mon, 8 Feb 2021 14:50:41 +0100 Subject: Return _meta dict, but with fewer value than expected --- dynamic.py | 6 +----- 1 file changed, 1 insertion(+), 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 -- cgit v1.2.3