From 8b2dace29baf78c5f0ddd68ff6974dd25725dcfe Mon Sep 17 00:00:00 2001 From: Chris Wells Date: Sat, 28 Jan 2017 12:30:27 -0500 Subject: [PATCH] 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). --- roles/ceph-rgw/tasks/multisite/main.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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