mirror of https://github.com/ansible/ansible.git
unarchive - properly handle relative path for `dest` (#75267)
* unarchive - properly handle relative path for dest * Add integration test * Return output of underlying commands with increased verbosity * Revert "Return output of underlying commands with increased verbosity" This reverts commit a2790c8275cdc5697b65670a0beffdc74b741bf6. * Warn when a relative destination path was providedpull/80122/head
parent
f47bc03599
commit
a56428de11
@ -0,0 +1,2 @@
|
||||
bugfixes:
|
||||
- unarchive - allow relative path for ``dest`` (https://github.com/ansible/ansible/issues/64612)
|
@ -0,0 +1,26 @@
|
||||
- name: Create relative test directory
|
||||
file:
|
||||
path: test-unarchive-relative
|
||||
state: directory
|
||||
|
||||
- name: Unarchive a file using a relative destination path
|
||||
unarchive:
|
||||
src: "{{ remote_tmp_dir }}/test-unarchive.tar"
|
||||
dest: test-unarchive-relative
|
||||
remote_src: yes
|
||||
register: relative_dest_1
|
||||
|
||||
- name: Unarchive a file using a relative destination path again
|
||||
unarchive:
|
||||
src: "{{ remote_tmp_dir }}/test-unarchive.tar"
|
||||
dest: test-unarchive-relative
|
||||
remote_src: yes
|
||||
register: relative_dest_2
|
||||
|
||||
- name: Ensure changes were made correctly
|
||||
assert:
|
||||
that:
|
||||
- relative_dest_1 is changed
|
||||
- relative_dest_1.warnings | length > 0
|
||||
- relative_dest_1.warnings[0] is search('absolute path')
|
||||
- relative_dest_2 is not changed
|
Loading…
Reference in New Issue