mirror of https://github.com/ansible/ansible.git
unarchive: Keep stderr when pick_handler fails (#76365)
* fixes #28977 * Include the original error message when pick_handler fails * Add a test to unarchive a tar file with an invalid extra option * add a changelogpull/76617/head
parent
fa617fcd7b
commit
594b11dc0c
@ -0,0 +1,2 @@
|
||||
bugfixes:
|
||||
- unarchive - include the original error when a handler cannot manage the archive (https://github.com/ansible/ansible/issues/28977).
|
@ -0,0 +1,27 @@
|
||||
- name: create our tar unarchive destination
|
||||
file:
|
||||
path: '{{remote_tmp_dir}}/test-unarchive-tar'
|
||||
state: directory
|
||||
|
||||
- name: unarchive a tar file with an invalid option
|
||||
unarchive:
|
||||
src: '{{remote_tmp_dir}}/test-unarchive.tar'
|
||||
dest: '{{remote_tmp_dir}}/test-unarchive-tar'
|
||||
remote_src: yes
|
||||
extra_opts:
|
||||
- "--invalid-éxtra-optら"
|
||||
ignore_errors: yes
|
||||
register: unarchive
|
||||
|
||||
- name: verify that the invalid option is in the error message
|
||||
assert:
|
||||
that:
|
||||
- "unarchive is failed"
|
||||
- "unarchive['msg'] is search(msg)"
|
||||
vars:
|
||||
msg: "Unable to list files in the archive: /.*/(tar|gtar): unrecognized option '--invalid-éxtra-optら'"
|
||||
|
||||
- name: remove our tar unarchive destination
|
||||
file:
|
||||
path: '{{remote_tmp_dir}}/test-unarchive-tar'
|
||||
state: absent
|
Loading…
Reference in New Issue