blob: bfb082c6aa77510e132619fffe4be78ca8672b81 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
- name: check if /tmp/foo-unarchive.text exists
stat:
path: /tmp/foo-unarchive.txt
ignore_errors: True
register: unarchive04
- name: fail if the proposed destination file exists for safey
fail:
msg: /tmp/foo-unarchive.txt already exists, aborting
when: unarchive04.stat.exists
- name: try unarchiving to /tmp
unarchive:
src: '{{remote_tmp_dir}}/test-unarchive.tar.gz'
dest: /tmp
remote_src: true
register: unarchive05
- name: verify that the file was marked as changed
assert:
that:
- "unarchive05.changed == true"
- name: verify that the file was unarchived
file:
path: /tmp/foo-unarchive.txt
state: file
- name: remove our unarchive destination
file:
path: /tmp/foo-unarchive.txt
state: absent
|