|
1 | 1 | --- |
| 2 | +- name: Build Ceph RGW overrides for configure_object |
| 3 | + hosts: localhost |
| 4 | + gather_facts: false |
| 5 | + tasks: |
| 6 | + - name: Extract Swift password from OpenShift secret |
| 7 | + ansible.builtin.shell: | |
| 8 | + oc get secret osp-secret -o json | jq -r '.data.SwiftPassword' | base64 -d |
| 9 | + register: swift_password_result |
| 10 | + changed_when: false |
| 11 | + |
| 12 | + - name: Get keystone-internal service details |
| 13 | + ansible.builtin.shell: "oc get svc keystone-internal -o json | jq -r '.status.loadBalancer.ingress[0].ip'" |
| 14 | + register: keystone_svc_lb_ip |
| 15 | + changed_when: false |
| 16 | + |
| 17 | + - name: Construct Keystone service URL |
| 18 | + ansible.builtin.set_fact: |
| 19 | + keystone_url: "{{ keystone_protocol | default('http') }}://{{ keystone_svc_lb_ip.stdout | ansible.utils.ipwrap }}:5000" |
| 20 | + when: keystone_svc_lb_ip.stdout | length > 0 |
| 21 | + |
| 22 | + - name: Set Ceph relevant network facts |
| 23 | + ansible.builtin.set_fact: |
| 24 | + ceph_storage_net_prefix: "2620:cf:cf:cccc" |
| 25 | + |
| 26 | + - name: Build ceph RGW overrides for configure_object |
| 27 | + ansible.builtin.blockinfile: |
| 28 | + marker_begin: "BEGIN ceph nodes vars for configure rgw object" |
| 29 | + marker_end: "END ceph nodes vars for configure rgw object" |
| 30 | + path: "{{ dpa_dir }}/tests/ceph_overrides.yaml" |
| 31 | + block: | |
| 32 | + ceph_keystone_ep: "{{ keystone_url }}" |
| 33 | + ceph_keystone_swift_pwd: "{{ swift_password_result.stdout }}" |
| 34 | + # rgw vip is required by configure_object task |
| 35 | + ceph_rgw_virtual_ips_list: |
| 36 | + - {{ ceph_storage_net_prefix }}::2/64 |
| 37 | +
|
2 | 38 | - name: Configure Ceph RGW Keystone settings |
3 | 39 | hosts: "{{ groups['ceph'][0] | default([]) }}" |
4 | 40 | gather_facts: true |
|
0 commit comments