diff --git a/lib/ansible/plugins/action/__init__.py b/lib/ansible/plugins/action/__init__.py index ca1d339ed2..d6d0d742bd 100644 --- a/lib/ansible/plugins/action/__init__.py +++ b/lib/ansible/plugins/action/__init__.py @@ -236,11 +236,11 @@ class ActionBase(with_metaclass(ABCMeta, object)): try: admin_users = self._connection._shell.get_option('admin_users') + [remote_user] - except KeyError: + except AnsibleError: admin_users = ['root', remote_user] # plugin does not support admin_users try: remote_tmp = self._connection._shell.get_option('remote_tmp') - except KeyError: + except AnsibleError: remote_tmp = '~/ansible' # deal with tmpdir creation @@ -405,7 +405,7 @@ class ActionBase(with_metaclass(ABCMeta, object)): try: admin_users = self._connection._shell.get_option('admin_users') - except KeyError: + except AnsibleError: admin_users = ['root'] # plugin does not support admin users if self._play_context.become and self._play_context.become_user and self._play_context.become_user not in admin_users + [remote_user]: diff --git a/lib/ansible/plugins/shell/powershell.py b/lib/ansible/plugins/shell/powershell.py index 2b43bc9ecf..3fd6411e15 100644 --- a/lib/ansible/plugins/shell/powershell.py +++ b/lib/ansible/plugins/shell/powershell.py @@ -21,12 +21,6 @@ DOCUMENTATION = ''' key: remote_tmp vars: - name: ansible_remote_tmp - admin_users: - description: - - List of users to be expected to have admin privileges, this is unused - in the PowerShell plugin - type: list - default: [] set_module_language: description: - Controls if we set the locale for moduels when executing on the