diff --git a/lib/ansible/modules/network/nxos/nxos_static_route.py b/lib/ansible/modules/network/nxos/nxos_static_route.py index 7002d8b7c3..ac6da67b98 100644 --- a/lib/ansible/modules/network/nxos/nxos_static_route.py +++ b/lib/ansible/modules/network/nxos/nxos_static_route.py @@ -280,13 +280,11 @@ def main(): candidate = CustomNetworkConfig(indent=3) reconcile_candidate(module, candidate, prefix, w) - if candidate: + if not module.check_mode and candidate: candidate = candidate.items_text() load_config(module, candidate) result['commands'].extend(candidate) result['changed'] = True - else: - result['commands'] = [] module.exit_json(**result)