rgw/multisite: assign 'rgw_zone' to the exact section in ceph.conf

since the following commit:
  commit 1ac94c048f
  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 a0590cae9d)
pull/4396/head
guihecheng 2019-01-23 09:36:25 +08:00 committed by Guillaume Abrioux
parent 27014df45e
commit 196e70a75a
1 changed files with 4 additions and 1 deletions

View File

@ -19,7 +19,10 @@
- name: add zone to rgw stanza in ceph.conf - name: add zone to rgw stanza in ceph.conf
ini_file: ini_file:
dest: "/etc/ceph/{{ cluster }}.conf" dest: "/etc/ceph/{{ cluster }}.conf"
section: "client.rgw.{{ ansible_hostname }}" section: "client.rgw.{{ ansible_hostname }}.{{ item.instance_name }}"
option: "rgw_zone" option: "rgw_zone"
value: "{{ rgw_zone }}" value: "{{ rgw_zone }}"
with_items: "{{ rgw_instances }}"
when:
- rgw_instances is defined
notify: restart rgw notify: restart rgw