diff --git a/lib/ansible/plugins/action/nxos.py b/lib/ansible/plugins/action/nxos.py index 7c8ccfec3d9..df03253c0c8 100644 --- a/lib/ansible/plugins/action/nxos.py +++ b/lib/ansible/plugins/action/nxos.py @@ -116,7 +116,11 @@ class ActionModule(_ActionModule): self._task.args['transport'] = transport result = super(ActionModule, self).run(tmp, task_vars) - del result['invocation']['module_args']['provider'] + + try: + del result['invocation']['module_args']['provider'] + except KeyError: + pass return result