Skip to content

Commit 126c7a1

Browse files
committed
more stuff in the playbook as we cannot do them before adoption
1 parent e4a806e commit 126c7a1

File tree

2 files changed

+46
-1
lines changed

2 files changed

+46
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ test-with-ironic: ## Launch test suite with Ironic
9898
test-configure-object: TEST_OUTFILE ?= tests/logs/test_configure_object_out_$(shell date +%FT%T%Z).log
9999
test-configure-object: ## Configure Swift object store to use Ceph RGW
100100
mkdir -p tests/logs
101-
ANSIBLE_CONFIG=$(TEST_CONFIG) ansible-playbook -v -i $(TEST_INVENTORY) -e @$(TEST_SECRETS) -e @$(TEST_VARS) $(TEST_ARGS) tests/playbooks/configure_swift_rgw.yaml 2>&1 | tee $(TEST_OUTFILE)
101+
ANSIBLE_CONFIG=$(TEST_CONFIG) ansible-playbook -v -i $(TEST_INVENTORY) -e @$(TEST_SECRETS) -e @$(TEST_VARS) -e @$(TEST_CEPH_OVERRIDES) $(TEST_ARGS) tests/playbooks/configure_swift_rgw.yaml 2>&1 | tee $(TEST_OUTFILE)
102102

103103
##@ DOCS
104104

tests/playbooks/configure_swift_rgw.yaml

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

0 commit comments

Comments
 (0)