From 55a693da8642f62366d60d95fef2142c6d8dc41f Mon Sep 17 00:00:00 2001 From: L3D Date: Sun, 26 Jun 2022 02:31:29 +0200 Subject: [PATCH] update inventory --- inventory.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/inventory.py b/inventory.py index d119343..7dc3294 100755 --- a/inventory.py +++ b/inventory.py @@ -12,7 +12,7 @@ env_dict = { 'work': ['workstation.local'], 'private': - ['derpy.local', 'foo.bar'] + ['derpy.local', 'applejack.local'] } def fqdn(): @@ -29,14 +29,14 @@ def env(domain): for key, values in env_dict.items(): if domain in values: return key - print(json.dumps(empty_host_list(), sort_keys=True, indent=2)) + print(json.dumps(empty_host_list(domain), sort_keys=True, indent=2)) sys.exit() -def empty_host_list(): +def empty_host_list(domain): """ return empty host list """ - comment = "No valid host found. returning empty host list!" + comment = f"No valid host found. Found '{domain}'. Return empty host list!" return json.loads('{"_meta": {"comment": "' + comment + '", "hostvars": {}}, "instances": {"hosts": []}}')