-
Notifications
You must be signed in to change notification settings - Fork 3
/
list-operators.yml
65 lines (58 loc) · 1.64 KB
/
list-operators.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
- hosts: localhost
gather_facts: false
vars_files:
- roles/olm_disconnected/vars/main.yml
tasks:
- name: Initialize operator list
set_fact:
redhat: []
community: []
certified: []
- name: Download Red Hat package data
uri:
url: https://quay.io/cnr/api/v1/packages?namespace=redhat-operators
return_content: yes
register: packages
- name: Generate Red Hat operator list
set_fact:
redhat: "{{ redhat + new_item }}"
vars:
new_item:
- "{{ item.name.split('/')[-1] }}"
with_items: "{{ packages.json }}"
loop_control:
label: "{{ item.name }}"
- name: Download community package data
uri:
url: https://quay.io/cnr/api/v1/packages?namespace=community-operators
return_content: yes
register: packages
- name: Generate community operator list
set_fact:
community: "{{ community + new_item }}"
vars:
new_item:
- "{{ item.name.split('/')[-1] }}"
with_items: "{{ packages.json }}"
loop_control:
label: "{{ item.name }}"
- name: Download certified package data
uri:
url: https://quay.io/cnr/api/v1/packages?namespace=certified-operators
return_content: yes
register: packages
- name: Generate certified operator list
set_fact:
certified: "{{ certified + new_item }}"
vars:
new_item:
- "{{ item.name.split('/')[-1] }}"
with_items: "{{ packages.json }}"
loop_control:
label: "{{ item.name }}"
- name: Print operator list
debug:
msg:
- redhat: "{{ redhat|sort }}"
- community: "{{ community|sort }}"
- certified: "{{ certified|sort }}"