Debian Codegraph @

test/integration/targets/ansible-galaxy-collection-scm/tasks/download.yml

raw
1 - name: create test download dir
2 file:
3 path: '{{ galaxy_dir }}/download'
4 state: directory
5
6 - name: download a git repository
7 command: >
8 ansible-galaxy collection download
9 git+https://github.com/ansible-collections/amazon.aws.git,37875c5b4ba5bf3cc43e07edf29f3432fd76def5
10 git+https://github.com/AlanCoding/awx.git#awx_collection,750c22a150d04eef1cb625fd4f83cce57949416c
11 --no-deps
12 args:
13 chdir: '{{ galaxy_dir }}/download'
14 register: download_collection
15 # TODO: remove external dependencies and define requires_ansible based on the current version
16 environment:
17 ANSIBLE_COLLECTIONS_ON_ANSIBLE_VERSION_MISMATCH: ignore
18
19 - name: check that the amazon.aws collection was downloaded
20 stat:
21 path: '{{ galaxy_dir }}/download/collections/amazon-aws-1.0.0.tar.gz'
22 register: download_collection_amazon_actual
23 environment:
24 ANSIBLE_COLLECTIONS_ON_ANSIBLE_VERSION_MISMATCH: ignore
25
26 - name: check that the awx.awx collection was downloaded
27 stat:
28 path: '{{ galaxy_dir }}/download/collections/awx-awx-0.0.1-devel.tar.gz'
29 register: download_collection_awx_actual
30
31 - assert:
32 that:
33 - '"Downloading collection ''amazon.aws:1.0.0'' to" in download_collection.stdout'
34 - '"Downloading collection ''awx.awx:0.0.1-devel'' to" in download_collection.stdout'
35 - download_collection_amazon_actual.stat.exists
36 - download_collection_awx_actual.stat.exists
37
38 - name: test the downloaded repository can be installed
39 command: 'ansible-galaxy collection install -r requirements.yml --no-deps'
40 args:
41 chdir: '{{ galaxy_dir }}/download/collections/'
42 environment:
43 ANSIBLE_COLLECTIONS_ON_ANSIBLE_VERSION_MISMATCH: ignore
44
45 - name: list installed collections
46 command: 'ansible-galaxy collection list'
47 register: installed_collections
48
49 - assert:
50 that:
51 - "'amazon.aws' in installed_collections.stdout"
52 - "'awx.awx' in installed_collections.stdout"
53
54 - include_tasks: ./empty_installed_collections.yml
55 when: cleanup