commit | author | age
|
e28b28
|
1 |
--- |
5082d2
|
2 |
- name: "{{ ceph_workload_title }} Ceph tools and filesystem" |
e28b28
|
3 |
k8s: |
PG |
4 |
state: "{{ ceph_workload_state }}" |
|
5 |
definition: "{{ lookup('template', item) }}" |
|
6 |
loop: |
|
7 |
- "toolbox.yaml.j2" |
|
8 |
- "filesystem.yaml.j2" |
|
9 |
tags: |
|
10 |
- ceph_post_dep |
|
11 |
|
5082d2
|
12 |
- name: Getting secret values for storage class [1] |
e28b28
|
13 |
shell: "pod=$(oc get pod -n rook-ceph -l app=rook-ceph-operator -o jsonpath='{.items[0].metadata.name}'); oc exec -ti -n rook-ceph ${pod} -- bash -c 'ceph auth get-key client.admin -c /var/lib/rook/rook-ceph/rook-ceph.config | base64'" |
PG |
14 |
register: cephfs_admin_key |
|
15 |
until: cephfs_admin_key.stdout != "" |
|
16 |
retries: 15 |
|
17 |
delay: 3 |
5082d2
|
18 |
when: not ceph_workload_destroy | bool |
e28b28
|
19 |
|
5082d2
|
20 |
- name: Getting secret values for storage class [2] |
e28b28
|
21 |
shell: "pod=$(oc get pod -n rook-ceph -l app=rook-ceph-operator -o jsonpath='{.items[0].metadata.name}'); oc exec -ti -n rook-ceph ${pod} -- bash -c 'echo -n admin|base64'" |
PG |
22 |
register: cephfs_admin_id |
|
23 |
until: cephfs_admin_id.stdout != "" |
|
24 |
retries: 15 |
|
25 |
delay: 3 |
5082d2
|
26 |
when: not ceph_workload_destroy | bool |
e28b28
|
27 |
|
PG |
28 |
- set_fact: |
|
29 |
ceph_cephfs_admin_id: "{{ cephfs_admin_id.stdout }}" |
|
30 |
ceph_cephfs_admin_key: "{{ cephfs_admin_key.stdout }}" |
5082d2
|
31 |
ceph_rbd_admin_id: "{{ cephfs_admin_id.stdout }}" |
PG |
32 |
ceph_rbd_admin_key: "{{ cephfs_admin_key.stdout }}" |
|
33 |
when: not ceph_workload_destroy | bool |
e28b28
|
34 |
|
5082d2
|
35 |
- name: "{{ ceph_workload_title }} Ceph storage classes" |
e28b28
|
36 |
k8s: |
PG |
37 |
state: "{{ ceph_workload_state }}" |
|
38 |
definition: "{{ lookup('template', item) }}" |
|
39 |
loop: |
|
40 |
- "cephfs.yaml.j2" |
|
41 |
- "rbd.yaml.j2" |
|
42 |
tags: |
|
43 |
- ceph_post_dep |
|
44 |
- ceph_sc_dep |
|
45 |
|
5082d2
|
46 |
- synchronize: |
PG |
47 |
src: "{{ role_path }}/files/cleanup.sh" |
|
48 |
dest: /tmp/cleanup.sh |
|
49 |
when: ceph_workload_destroy | bool |
e28b28
|
50 |
|
5082d2
|
51 |
- name: Cleaning up leftover directories |
PG |
52 |
shell: "/bin/bash /tmp/cleanup.sh" |
|
53 |
ignore_errors: yes |
|
54 |
when: ceph_workload_destroy | bool |
|
55 |
|
|
56 |
- name: Removing cleanup script |
e28b28
|
57 |
file: |
5082d2
|
58 |
path: /tmp/cleanup.sh |
PG |
59 |
state: absent |
|
60 |
when: ceph_workload_destroy | bool |