-
Notifications
You must be signed in to change notification settings - Fork 11
/
16-provision-cluster-storage.yml
39 lines (35 loc) · 1.28 KB
/
16-provision-cluster-storage.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
---
- name: create persistent volumes in the cluster
hosts: localhost
become: no
gather_facts: no
tasks:
- name: generate the resource definitions
template:
src: templates/pv.yml.j2
dest: /tmp/pv-{{ item.name }}.yml
mode: 0600
loop: "{{ nfs_exports }}"
- name: create them pvs
command: >
{{ oc_bin }} --kubeconfig={{ openshift_rtdata_path }}/auth/kubeconfig
apply -f /tmp/pv-{{ item.name }}.yml
loop: "{{ nfs_exports }}"
- name: kill the pv files
file:
path: /tmp/pv-{{ item.name }}.yml
state: absent
loop: "{{ nfs_exports }}"
- name: check the image-registry operator configuration
command: >
{{ oc_bin }} --kubeconfig={{ openshift_rtdata_path }}/auth/kubeconfig
get configs.imageregistry.operator.openshift.io cluster -o jsonpath='{.spec.storage}'
changed_when: never is defined
register: regstate
- name: now fix the operator config if so required
command: >
{{ oc_bin }} --kubeconfig={{ openshift_rtdata_path }}/auth/kubeconfig
patch configs.imageregistry.operator.openshift.io cluster --type=merge
-p '{ "spec": { "storage": { "pvc": { "claim": "" } } } }'
when: (regstate.stdout | regex_search('^map\\[\\]'))
...