summaryrefslogtreecommitdiff
path: root/test/integration/targets/unarchive/tasks/test_download.yml
blob: 93c7b1e3dcc626319efa7002386f0b02af6f0434 (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
# Test downloading a file before unarchiving it
- name: create our unarchive destination
  file:
    path: '{{remote_tmp_dir}}/test-unarchive-tar-gz'
    state: directory

- name: Install packages to make TLS connections work on CentOS 6
  pip:
    name:
      - pyasn1 == 0.4.8 ; python_version == '2.6'  # 0.5.0 drops support for Python 2.6
      - urllib3==1.10.2
      - ndg_httpsclient==0.4.4
      - pyOpenSSL==16.2.0
    state: present
  when:
    - ansible_facts.distribution == 'CentOS'
    - not ansible_facts.python.has_sslcontext

- name: unarchive a tar from an URL
  unarchive:
    src: "https://releases.ansible.com/ansible/ansible-latest.tar.gz"
    dest: "{{ remote_tmp_dir }}/test-unarchive-tar-gz"
    mode: "0700"
    remote_src: yes
  register: unarchive13

- name: Test that unarchive succeeded
  assert:
    that:
      - "unarchive13.changed == true"

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