summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/unarchive/tasks/test_tar_gz_creates.yml
blob: fa3a23f8b867e30f728d905d488f664ac89b954e (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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
- name: create our tar.gz unarchive destination for creates
  file:
    path: '{{remote_tmp_dir}}/test-unarchive-tar-gz'
    state: directory

- name: unarchive a tar.gz file with creates set
  unarchive:
    src: '{{remote_tmp_dir}}/test-unarchive.tar.gz'
    dest: '{{remote_tmp_dir}}/test-unarchive-tar-gz'
    creates: '{{remote_tmp_dir}}/test-unarchive-tar-gz/foo-unarchive.txt'
    remote_src: yes
  register: unarchive02b

- name: verify that the file was marked as changed
  assert:
    that:
      - "unarchive02b.changed == true"

- name: verify that the file was unarchived
  file:
    path: '{{remote_tmp_dir}}/test-unarchive-tar-gz/foo-unarchive.txt'
    state: file

- name: unarchive a tar.gz file with creates over an existing file
  unarchive:
    src: '{{remote_tmp_dir}}/test-unarchive.tar.gz'
    dest: '{{remote_tmp_dir}}/test-unarchive-tar-gz'
    creates: '{{remote_tmp_dir}}/test-unarchive-tar-gz/foo-unarchive.txt'
    remote_src: yes
  register: unarchive02c

- name: verify that the file was not marked as changed
  assert:
    that:
      - "unarchive02c.changed == false"

- name: unarchive a tar.gz file with creates over an existing file using complex_args
  unarchive:
    src: "{{remote_tmp_dir}}/test-unarchive.tar.gz"
    dest: "{{remote_tmp_dir}}/test-unarchive-tar-gz"
    remote_src: yes
    creates: "{{remote_tmp_dir}}/test-unarchive-tar-gz/foo-unarchive.txt"
  register: unarchive02d

- name: verify that the file was not marked as changed
  assert:
    that:
      - "unarchive02d.changed == false"

- name: remove our tar.gz unarchive destination
  file:
    path: '{{remote_tmp_dir}}/test-unarchive-tar-gz'
    state: absent