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 <tonay@ibm.com>
(cherry picked from commit bc54290718)
pull/7454/head
Teoman ONAY 2023-08-04 11:17:44 +02:00 committed by Teoman ONAY
parent 91c57b662d
commit 0b2826132e
1 changed files with 9 additions and 0 deletions

View File

@ -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