diff --git a/lib/ansible/module_utils/network/nxos/nxos.py b/lib/ansible/module_utils/network/nxos/nxos.py index 5beee80d32d..8ca12f10f1f 100644 --- a/lib/ansible/module_utils/network/nxos/nxos.py +++ b/lib/ansible/module_utils/network/nxos/nxos.py @@ -161,7 +161,7 @@ class Cli: if network_api == 'cliconf' and out: for index, resp in enumerate(out): - if 'Invalid command at' in resp and 'json' in resp: + if ('Invalid command at' in resp or 'Ambiguous command at' in resp) and 'json' in resp: if commands[index]['output'] == 'json': commands[index]['output'] = 'text' out = connection.run_commands(commands, check_rc)