]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
rgw/multisite: assign 'rgw_zone' to the exact section in ceph.conf
authorguihecheng <guihecheng@cmiot.chinamobile.com>
Wed, 23 Jan 2019 01:36:25 +0000 (09:36 +0800)
committerGuillaume Abrioux <gabrioux@redhat.com>
Fri, 23 Aug 2019 13:56:15 +0000 (15:56 +0200)
since the following commit:
  commit 1ac94c048ff1d1385de2892d0ecef7879ec563e9
  rgw: add support for multiple rgw instances on a single host

we have multi-instance rgw support on a single host and
the config section name of the rgw changed from
[client.rgw.$(hostname)] -> [client.rgw.$(hostname).rgwX]
when X is the sequence number: 0,1,2,...
So we should assign 'rgw_zone' item to the exact rgw instance
config section in ceph.conf

Signed-off-by: guihecheng <guihecheng@cmiot.chinamobile.com>
(cherry picked from commit a0590cae9d2da15bfa25da38ce5ac42eb7203502)

roles/ceph-rgw/tasks/multisite/main.yml

index 18a6468482244a5b797da2a96b36c17285f4c945..5a5bedb897a815163a756aee77fd8748a912a27c 100644 (file)
 - name: add zone to rgw stanza in ceph.conf
   ini_file:
     dest: "/etc/ceph/{{ cluster }}.conf"
-    section: "client.rgw.{{ ansible_hostname }}"
+    section: "client.rgw.{{ ansible_hostname }}.{{ item.instance_name }}"
     option: "rgw_zone"
     value: "{{ rgw_zone }}"
+  with_items: "{{ rgw_instances }}"
+  when:
+    - rgw_instances is defined
   notify: restart rgw