Debian Codegraph @

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

raw
1 - name: Install all collections by default
2 command: 'ansible-galaxy collection install git+file://{{ test_repo_path }}/.git'
3
4 - name: list installed collections
5 command: 'ansible-galaxy collection list'
6 register: installed_collections
7
8 - assert:
9 that:
10 - "'ansible_test.collection_1' in installed_collections.stdout"
11 - "'ansible_test.collection_2' in installed_collections.stdout"
12
13 - name: install from artifact to another path to compare contents
14 command: 'ansible-galaxy collection install {{ artifact_path }} -p {{ alt_install_path }} --no-deps'
15 vars:
16 artifact_path: "{{ galaxy_dir }}/ansible_test-collection_1-1.0.0.tar.gz"
17 environment:
18 ANSIBLE_COLLECTIONS_PATH: ""
19
20 - name: check if the files and folders in build_ignore were respected
21 stat:
22 path: "{{ install_path }}/ansible_test/collection_1/{{ item }}"
23 register: result
24 loop:
25 - foo.txt
26 - foobar/baz.txt
27 - foobar/qux
28
29 - assert:
30 that: result.results | map(attribute='stat') | map(attribute='exists') is not any
31
32 - name: check that directory with ignored files exists and is empty
33 stat:
34 path: "{{ install_path }}/ansible_test/collection_1/foobar"
35 register: result
36
37 - assert:
38 that: result.stat.exists
39
40 - name: test that there are no diff installing from a repo vs artifact
41 command: "diff -ur {{ collection_from_artifact }} {{ collection_from_repo }} -x *.json"
42 vars:
43 collection_from_repo: "{{ install_path }}/ansible_test/collection_1"
44 collection_from_artifact: "{{ alt_install_path }}/ansible_test/collection_1"
45
46 - include_tasks: ./empty_installed_collections.yml
47 when: cleanup