forked from redhat-cop/agnosticd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_collections_ee.yml
41 lines (36 loc) · 1.15 KB
/
install_collections_ee.yml
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
---
- name: Get the list of installed collections (EE)
command: >-
ansible-galaxy collection list --format json
register: r_installed_collections
- name: Create temporary file for requirements.yml (EE)
ansible.builtin.tempfile:
state: file
suffix: requirements
register: tempfile_1
- name: Rewrite requirements, filter out installed collections (EE)
vars:
installed_collections: >-
{{ r_installed_collections.stdout | from_json }}
copy:
dest: "{{ tempfile_1.path }}"
content: >-
{{ r_requirements_content
| agnosticd_filter_out_installed_collections(installed_collections)
| to_yaml }}
- name: Install collections from requirements.yml (EE)
vars:
__collections_path: "{{ lookup('config', 'COLLECTIONS_PATHS')[0] }}"
command: >-
ansible-galaxy collection install
-r "{{ tempfile_1.path }}"
-p "{{ __collections_path | quote }}"
--force-with-deps
register: r_ee_ansible_galaxy_install_collections
until: r_ee_ansible_galaxy_install_collections is successful
retries: 10
delay: 30
- name: Cleanup tempfile (EE)
ansible.builtin.file:
path: "{{ tempfile_1.path }}"
state: absent