From 26d419c9a52b140364ffab598062f75fd27177ad Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 7 Nov 2024 20:46:24 +0100 Subject: [PATCH] Cater for unmonitored hosts --- personal_infra/pseudo_resource_exporter.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/personal_infra/pseudo_resource_exporter.py b/personal_infra/pseudo_resource_exporter.py index 9ef498b..fb961c6 100755 --- a/personal_infra/pseudo_resource_exporter.py +++ b/personal_infra/pseudo_resource_exporter.py @@ -47,7 +47,9 @@ ail = subprocess.run(["ansible-inventory", "--list"], check=True, stdout=subproc inventory = json.loads(ail.stdout) total_hosts_in_inventory = len(inventory["_meta"]["hostvars"].keys()) k8s_hosts_in_inventory = len(inventory["k8s"]["hosts"]) -puppet_hosts_in_inventory = total_hosts_in_inventory - k8s_hosts_in_inventory +unmonitored_hosts_in_inventory = len(inventory["unmonitored"]["hosts"]) + +puppet_hosts_in_inventory = total_hosts_in_inventory - k8s_hosts_in_inventory - unmonitored_hosts_in_inventory catalog_files = list(pathlib.Path("build/puppet/build/output/").glob("*/catalog.json")) -- 2.47.3