-
Notifications
You must be signed in to change notification settings - Fork 3
/
get-operator-csv.yml
43 lines (38 loc) · 1.06 KB
/
get-operator-csv.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
- hosts: localhost
gather_facts: false
vars_files:
- roles/olm_disconnected/vars/main.yml
- config.yml
tasks:
- name: Make temp directory
tempfile:
state: directory
suffix: mig_olm_disconnected
register: tmp_dir
- include_tasks: roles/olm_disconnected/tasks/get_operator.yml
loop: "{{ operators }}"
loop_control:
loop_var: operator
vars:
tmp_dir_path: "{{ tmp_dir.path }}"
- name: Create catalog directory structure
file:
path: "{{ tmp_dir.path }}/manifests/{{ item.name }}"
state: directory
with_items: "{{ operators }}"
- name: Extract operator metadata
shell: "bsdtar --strip-components 1 -xf {{ item.name }}.tar.gz -C manifests/{{ item.name }}/"
args:
chdir: "{{ tmp_dir.path }}"
with_items: "{{ operators }}"
- name: Find CSVs
find:
paths: "{{ tmp_dir.path }}/manifests"
patterns: '*clusterserviceversion*'
recurse: true
register: csvs
- name: Copy CSVs
copy:
src: "{{ item.path }}"
dest: ./
with_items: "{{ csvs.files }}"