From 8b5aa118ed0a7e2f5e59074edcbf10cdde49d11e Mon Sep 17 00:00:00 2001 From: Teoman ONAY Date: Fri, 4 Aug 2023 11:17:44 +0200 Subject: [PATCH] cephadm-adopt: Add --networks parameter support to ceph orch apply rgw When radosgw_address_block was defined, it was not taken into account during rgw adoption process depends on: https://tracker.ceph.com/issues/62185 fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2224351 Signed-off-by: Teoman ONAY (cherry picked from commit bc54290718b9303c9eadc1f6c4e7c0e79e54e41c) --- infrastructure-playbooks/cephadm-adopt.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/infrastructure-playbooks/cephadm-adopt.yml b/infrastructure-playbooks/cephadm-adopt.yml index c44edf9ef..27d45e1b5 100644 --- a/infrastructure-playbooks/cephadm-adopt.yml +++ b/infrastructure-playbooks/cephadm-adopt.yml @@ -1006,11 +1006,19 @@ environment: CEPHADM_IMAGE: '{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}' + - name: set_fact rgw_subnet + set_fact: + rgw_subnet: "--networks {{ radosgw_address_block }}" + when: + - radosgw_address_block is defined + - radosgw_address_block != 'subnet' + - name: update the placement of radosgw hosts command: > {{ cephadm_cmd }} shell -k /etc/ceph/{{ cluster }}.client.admin.keyring --fsid {{ fsid }} -- ceph orch apply rgw {{ ansible_facts['hostname'] }} --placement='count-per-host:{{ radosgw_num_instances }} {{ ansible_facts['nodename'] }}' + {{ rgw_subnet if rgw_subnet is defined else '' }} --port={{ radosgw_frontend_port }} {{ '--ssl' if radosgw_frontend_ssl_certificate else '' }} changed_when: false @@ -1025,6 +1033,7 @@ ceph orch apply rgw {{ ansible_facts['hostname'] }}.{{ item.rgw_realm }}.{{ item.rgw_zone }}.{{ item.radosgw_frontend_port }} --placement={{ ansible_facts['nodename'] }} --realm={{ item.rgw_realm }} --zone={{ item.rgw_zone }} + {{ rgw_subnet if rgw_subnet is defined else '' }} --port={{ item.radosgw_frontend_port }} {{ '--ssl' if radosgw_frontend_ssl_certificate else '' }} changed_when: false -- 2.39.5