-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patholm-test-playbook.yaml
79 lines (61 loc) · 1.99 KB
/
olm-test-playbook.yaml
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
66
67
68
69
70
71
72
73
74
75
76
77
78
- name: Run OLM test
hosts: localhost
become: yes
gather_facts: false
vars:
# https://quay.io/repository/vrushch/vrushal-csi-driver-repo-2
# In above ${QUAY_NAMESPACE} = vrushch, ${PACKAGE_NAME} = vrushal-csi-driver-repo-2
QUAY_NAMESPACE: vrushch
PACKAGE_NAME: vrushal-csi-driver-repo-2
OPERATOR_VERSIONS:
- 1.0.0
- 1.1.0
- 2.0.0
- 2.1.0
QUAY_USERNAME: "vrushch"
QUAY_PASSWORD: "XXXXXXXXXXX"
# Need not to be changed
CHANNEL_NAME: latest
OPERATOR_DIR: /root/ibm-spectrum-scale-csi/operator/deploy/olm-catalog/ibm-spectrum-scale-csi-operator
#It can also be /root/demo/community-operators/community-operators/ibm-spectrum-scale-csi-operator
# Do not change following variables
NAMESPACE: "openshift-marketplace"
INTERACTABLE: true
OC_SUB: "./olm-test/oc-sub.yaml.j2"
SUB: "/tmp/sub"
tasks:
- name: "Get timestamp"
shell: "date +%s"
register: tstamp
- name: "Determing directory for temporary package"
set_fact:
olm_dir: "/tmp/{{PACKAGE_NAME}}-{{tstamp.stdout}}"
- name: "Create the directory {{ olm_dir }}"
file:
path: "{{ olm_dir }}"
state: directory
mode: '0755'
- name: "Check for openshift"
shell: "which oc"
register: result
ignore_errors: true
- name: "Openshift detected using {{ OC_SUB }} for subscription"
set_fact:
subscription: "{{ OC_SUB }}"
when: result.rc == 0
- name: "Ensure subscription file is defined for consumption"
template:
src: "{{subscription}}"
dest: "{{ SUB }}"
- name: "Iterate over the operator versions."
include_tasks: "./olm-test/check-version-play.yaml"
loop: "{{ OPERATOR_VERSIONS }}"
- name: "Remove the file {{SUB}}"
file:
path: "{{ SUB }}"
state: absent
- name: "Remove the directory {{ olm_dir }}"
file:
path: "{{ olm_dir }}"
state: absent
mode: '0755'