community.general/lib/ansible/plugins
Dag Wieers 93cfe73a76 Report detailed error when internal remote functions fail
This is a redesign in how plugins call _remote_checksum().

- _remote_stat() has been modified to report the real error as
  AnsiblError
- Action plugin **unarchive** calls _remote_stat() directly instead of
   _remote_checksum()
- Action plugin **unarchive** also handles the exceptions directly
- Ensure get_exception() returns native text

Two other action plugins, **template** and **fetch**, also do a remote checksum.
In **template** we already call _remote_stat(), just like we now do for
unarchive, in **fetch** we do call _remote_checksum() and we make the
exact same mistake as the unarchive plugin. So that one could use a
redesign as well.

This fixes #19494

Before:
```
[dag@moria ansible.testing]$ ansible-playbook -v test137.yml
Using /home/dag/home-made/ansible.testing/ansible.cfg as config file

PLAY [localhost]
******************************************************************************************************

TASK [unarchive]
******************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg":
"python isn't present on the system.  Unable to compute checksum"}

PLAY RECAP
******************************************************************************************************
localhost                  : ok=0    changed=0    unreachable=0
failed=1
```

After:
```
[dag@moria ansible.testing]$ ansible-playbook -v test137.yml
Using /home/dag/home-made/ansible.testing/ansible.cfg as config file

PLAY [localhost]
*************************************************************************************************************

TASK [unarchive]
*************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg":
"Failed to get information on remote file (/tmp/): sudo: unknown user:
foobar\nsudo: unable to initialize policy plugin\n"}

PLAY RECAP
*******************************************************************************************************************
localhost                  : ok=0    changed=0    unreachable=0
failed=1
```
2016-12-19 21:04:48 -05:00
..
action Report detailed error when internal remote functions fail 2016-12-19 21:04:48 -05:00
cache bad/missing fact plugin is a warning (#19350) 2016-12-14 14:25:19 -05:00
callback Ensure that command/shell errors are displayed 2016-12-16 21:46:02 -05:00
connection adds feature to allow connection to set action plugin (#18762) 2016-12-15 15:47:39 -05:00
filter random filter: added optional 'seed' parameter 2016-11-17 15:02:06 -08:00
lookup with_sequence: pass AnsibleError through 2016-11-30 21:26:23 -08:00
shell Mcsalgado's change to use shlex.quote instead of pipes.quote (#18534) 2016-11-17 13:18:29 -08:00
strategy minor spelling changes 2016-12-13 13:51:13 -05:00
terminal removes network os guess static method (#19467) 2016-12-19 07:47:29 -05:00
test restored 'results' filters 2016-10-13 13:21:40 -04:00
vars Making the switch to v2 2015-05-03 21:47:26 -05:00
__init__.py adds two new plugins that use ansible-connection for persistence (#18572) 2016-11-28 12:49:40 -05:00