ac5f3f8bef
Add integration tests for unarchiving as unprivileged user Break tasks into separate files for easier reading and maintenance Create a user by specifying a default group of 'staff' for macOS. The user module does not actually remove the user directory on macOS, so explicitly remove it. Put the removal tasks in an always block to ensure they always run Co-authored-by: Philip Douglass <philip.douglass@amadeus.com> Co-authored-by: Sam Doran <sdoran@redhat.com>
47 lines
1.3 KiB
YAML
47 lines
1.3 KiB
YAML
# Test that unarchiving is performed if files are missing
|
|
# https://github.com/ansible/ansible-modules-core/issues/1064
|
|
- name: create our unarchive destination
|
|
file:
|
|
path: '{{remote_tmp_dir}}/test-unarchive-tar-gz'
|
|
state: directory
|
|
|
|
- name: unarchive a tar that has directories
|
|
unarchive:
|
|
src: "{{ remote_tmp_dir }}/test-unarchive-dir.tar.gz"
|
|
dest: "{{ remote_tmp_dir }}/test-unarchive-tar-gz"
|
|
mode: "0700"
|
|
remote_src: yes
|
|
register: unarchive10
|
|
|
|
- name: Test that unarchive succeeded
|
|
assert:
|
|
that:
|
|
- "unarchive10.changed == true"
|
|
|
|
- name: Change the mode of the toplevel dir
|
|
file:
|
|
path: "{{ remote_tmp_dir }}/test-unarchive-tar-gz/unarchive-dir"
|
|
mode: "0701"
|
|
|
|
- name: Remove a file from the extraction point
|
|
file:
|
|
path: "{{ remote_tmp_dir }}/test-unarchive-tar-gz/unarchive-dir/foo-unarchive.txt"
|
|
state: absent
|
|
|
|
- name: unarchive a tar that has directories
|
|
unarchive:
|
|
src: "{{ remote_tmp_dir }}/test-unarchive-dir.tar.gz"
|
|
dest: "{{ remote_tmp_dir }}/test-unarchive-tar-gz"
|
|
mode: "0700"
|
|
remote_src: yes
|
|
register: unarchive10_1
|
|
|
|
- name: Test that unarchive succeeded
|
|
assert:
|
|
that:
|
|
- "unarchive10_1.changed == true"
|
|
|
|
- name: remove our tar.gz unarchive destination
|
|
file:
|
|
path: '{{ remote_tmp_dir }}/test-unarchive-tar-gz'
|
|
state: absent
|