Skip to content
Snippets Groups Projects
Verified Commit 064275e4 authored by Karel van Klink's avatar Karel van Klink :smiley_cat:
Browse files

Add example skip playbook if inventory is empty

parent 9ea08606
No related branches found
No related tags found
1 merge request!267SDP mesh functions
Pipeline #89218 failed
This commit is part of merge request !267. Comments created here will be created in the context of that merge request.
......@@ -56,6 +56,9 @@ def _update_sdp_mesh(
inventory = generate_inventory_for_active_routers(
router_role=RouterRole.PE, router_vendor=Vendor.NOKIA, exclude_routers=[subscription["router"]["router_fqdn"]]
)
if len(inventory["all"]["hosts"].keys()) == 0:
return # Skip this Ansible interaction if the inventory is empty.
extra_vars = {
"dry_run": dry_run,
"subscription": subscription,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment