aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralex <alex@pdp7.net>2024-11-07 20:46:24 +0100
committeralexpdp7 <alex@corcoles.net>2024-11-07 20:47:22 +0100
commit26d419c9a52b140364ffab598062f75fd27177ad (patch)
tree5f39508490d14ea7960e66bf9e1209a652abf9bb
parentf5830d6f0a3aaa8f830bdb842fe939aecdb0f8f9 (diff)
Cater for unmonitored hosts
-rwxr-xr-xpersonal_infra/pseudo_resource_exporter.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/personal_infra/pseudo_resource_exporter.py b/personal_infra/pseudo_resource_exporter.py
index 9ef498bb..fb961c67 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"))