]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Handle adoption when radosgw_address_block is comma delimited list
authorJohn Fulton <fulton@redhat.com>
Thu, 16 Jan 2025 20:50:50 +0000 (15:50 -0500)
committerTeoman ONAY <tonay@ibm.com>
Thu, 6 Feb 2025 15:05:22 +0000 (16:05 +0100)
In cephadm-adopt.yml TASK "Update the placement of radosgw hosts"
passes module ceph_orch_apply embedded YAML via a block scalar.
This YAML creates a Ceph spec of service_type RGW. The networks
key of this spec supports either a list or a string. Without this
patch, the networks key of the spec will only contain a string.
With this patch a string is still set for the networks key, but
if Ansible var radosgw_address_block contains commas, then var
radosgw_address_block is split by those commas into a list and
the networks key of the spec will be set to a list.

Closes: https://issues.redhat.com/browse/RHCEPH-10418
Signed-off-by: John Fulton <fulton@redhat.com>
infrastructure-playbooks/cephadm-adopt.yml

index e542dcdd7ce84eb7535986ea96f0b602cb8014c1..612e5fe864de8cd25fdf339211b51901af8aa49a 100644 (file)
             hosts:
               - {{ ansible_facts['nodename'] }}
           {% if rgw_subnet is defined %}
-          networks: "{{ radosgw_address_block }}"
+          networks: {{ radosgw_address_block.split(',') | list if ',' in radosgw_address_block else radosgw_address_block | string }}
           {% endif %}
           spec:
             rgw_frontend_port: {{ radosgw_frontend_port }}