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

Add example skip playbook if inventory is empty

parent 10cd77c4
No related branches found
No related tags found
No related merge requests found
Pipeline #89214 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( ...@@ -56,6 +56,9 @@ def _update_sdp_mesh(
inventory = generate_inventory_for_active_routers( inventory = generate_inventory_for_active_routers(
router_role=RouterRole.PE, router_vendor=Vendor.NOKIA, exclude_routers=[subscription["router"]["router_fqdn"]] 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 = { extra_vars = {
"dry_run": dry_run, "dry_run": dry_run,
"subscription": subscription, "subscription": subscription,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment