From: Chris Wells Date: Sat, 28 Jan 2017 17:30:27 +0000 (-0500) Subject: Using ini_file with ansible_hostname to ensure each INI block gets the rgw_zone setti... X-Git-Tag: v2.2.0rc1~52^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F1256%2Fhead;p=ceph-ansible.git Using ini_file with ansible_hostname to ensure each INI block gets the rgw_zone setting in a multi-RGW setup. Also, ansible_hostname better matches what ceph-common does for the actual hostname (ansible_host != ansible_hostname under all conditions). --- diff --git a/roles/ceph-rgw/tasks/multisite/main.yml b/roles/ceph-rgw/tasks/multisite/main.yml index 0dc6d94da..2f7114a3d 100644 --- a/roles/ceph-rgw/tasks/multisite/main.yml +++ b/roles/ceph-rgw/tasks/multisite/main.yml @@ -17,11 +17,10 @@ # Continue with common tasks - name: add zone to rgw stanza in ceph.conf - lineinfile: + ini_file: dest: "/etc/ceph/{{ cluster }}.conf" - regexp: "{{ ansible_host }}" - insertafter: "^[client.rgw.{{ ansible_host }}]" - line: "rgw_zone = {{ rgw_zone }}" - state: present + section: "client.rgw.{{ ansible_hostname }}" + option: "rgw_zone" + value: "{{ rgw_zone }}" notify: - restart rgw