Update modules for unarchive handling user,group,mode and add integration test for the same

This commit is contained in:
Toshio Kuratomi 2015-01-14 19:23:12 -08:00
commit 6326daa34e
5 changed files with 47 additions and 8 deletions

View file

@ -95,13 +95,13 @@
dest: "{{output_dir | expanduser}}/test-unarchive-tar-gz"
copy: no
creates: "{{output_dir}}/test-unarchive-tar-gz/foo-unarchive.txt"
register: unarchive02c
register: unarchive02d
- name: verify that the file was not marked as changed
assert:
that:
- "unarchive02c.changed == false"
- "unarchive02c.skipped == true"
- "unarchive02d.changed == false"
- "unarchive02d.skipped == true"
- name: remove our tar.gz unarchive destination
file: path={{output_dir}}/test-unarchive-tar-gz state=absent
@ -121,7 +121,7 @@
- name: verify that the file was unarchived
file: path={{output_dir}}/test-unarchive-zip/foo-unarchive.txt state=file
- name: remove our tar unarchive destination
- name: remove our zip unarchive destination
file: path={{output_dir}}/test-unarchive-zip state=absent
- name: remove our test file for the archive
@ -150,3 +150,42 @@
- name: remove our unarchive destination
file: path=/tmp/foo-unarchive.txt state=absent
- name: create our unarchive destination
file: path={{output_dir}}/test-unarchive-tar-gz state=directory
- name: unarchive and set mode
unarchive:
src: "{{ output_dir }}/test-unarchive.tar.gz"
dest: "{{ output_dir | expanduser }}/test-unarchive-tar-gz"
copy: no
mode: "u+rwX,g-rwx,o-rwx"
register: unarchive06
- name: Test that the file modes were changed
stat:
path: "{{ output_dir | expanduser }}/test-unarchive-tar-gz/foo-unarchive.txt"
register: unarchive06_stat
- name: Test that the file modes were changed
assert:
that:
- "unarchive06.changed == true"
- "unarchive06_stat.stat.mode == '0600'"
- name: unarchive and set mode
unarchive:
src: "{{ output_dir }}/test-unarchive.tar.gz"
dest: "{{ output_dir | expanduser }}/test-unarchive-tar-gz"
copy: no
mode: "u+rwX,g-rwx,o-rwx"
register: unarchive07
- name: Test that the files were not changed
assert:
that:
- "unarchive07.changed == false"
- name: remove our tar.gz unarchive destination
file: path={{output_dir}}/test-unarchive-tar-gz state=absent