Skip to content
Snippets Groups Projects
Commit 663cc2a1 authored by Aleksandr Kurbatov's avatar Aleksandr Kurbatov
Browse files

Add check for empty extra_vars item

if in extra_vars a var that is a result of `generate_inventory..`
function is empty, skip the lso_interaction step altogether.

Kudos to KvK.
parent 3a1443a5
No related branches found
No related tags found
No related merge requests found
Pipeline #89520 passed
...@@ -93,6 +93,13 @@ def _update_sdp_single_pe( ...@@ -93,6 +93,13 @@ def _update_sdp_single_pe(
)["all"]["hosts"], )["all"]["hosts"],
} }
if not extra_vars["pe_router_list"]:
return {
"playbook_name": "",
"inventory": {"all": {"hosts": {}}},
"extra_vars": {},
}
return { return {
"playbook_name": "update_pe_sdp_mesh.yaml", "playbook_name": "update_pe_sdp_mesh.yaml",
"inventory": {"all": {"hosts": {subscription["router"]["router_fqdn"]: None}}}, "inventory": {"all": {"hosts": {subscription["router"]["router_fqdn"]: None}}},
...@@ -118,6 +125,13 @@ def _add_pe_mesh_to_pe( ...@@ -118,6 +125,13 @@ def _add_pe_mesh_to_pe(
)["all"]["hosts"], )["all"]["hosts"],
} }
if not extra_vars["pe_router_list"]:
return {
"playbook_name": "",
"inventory": {"all": {"hosts": {}}},
"extra_vars": {},
}
return { return {
"playbook_name": "update_ibgp_mesh.yaml", "playbook_name": "update_ibgp_mesh.yaml",
"inventory": {"all": {"hosts": {subscription["router"]["router_fqdn"]: None}}}, "inventory": {"all": {"hosts": {subscription["router"]["router_fqdn"]: None}}},
...@@ -167,6 +181,13 @@ def _add_all_p_to_pe( ...@@ -167,6 +181,13 @@ def _add_all_p_to_pe(
)["all"]["hosts"], )["all"]["hosts"],
} }
if not extra_vars["p_router_list"]:
return {
"playbook_name": "",
"inventory": {"all": {"hosts": {}}},
"extra_vars": {},
}
return { return {
"playbook_name": "update_ibgp_mesh.yaml", "playbook_name": "update_ibgp_mesh.yaml",
"inventory": {"all": {"hosts": {subscription["router"]["router_fqdn"]: None}}}, "inventory": {"all": {"hosts": {subscription["router"]["router_fqdn"]: None}}},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment