From: Guillaume Abrioux Date: Fri, 2 Jun 2017 08:06:19 +0000 (+0200) Subject: Common: Avoid duplicate section in ceph.conf X-Git-Tag: v3.0.0rc1~12^2~2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=894df4b8c8dafe840555121ddbd4b33f21228f60;p=ceph-ansible.git Common: Avoid duplicate section in ceph.conf See: - https://github.com/ceph/ceph-ansible/pull/1018#issuecomment-253491094 - https://github.com/ceph/ceph-ansible/pull/1018#issuecomment-260276588 The workaround here is rendering `ceph_conf_overrides` before passing it to `config_template` to be sure we won't have a section added twice in ceph.conf Signed-off-by: Guillaume Abrioux --- diff --git a/roles/ceph-common/tasks/generate_ceph_conf.yml b/roles/ceph-common/tasks/generate_ceph_conf.yml index c5d0b310d..f23a485d9 100644 --- a/roles/ceph-common/tasks/generate_ceph_conf.yml +++ b/roles/ceph-common/tasks/generate_ceph_conf.yml @@ -10,6 +10,14 @@ - /etc/ceph/ - /etc/ceph/ceph.d/ +- name: template ceph_conf_overrides + local_action: copy content="{{ ceph_conf_overrides }}" dest=/tmp/ceph_conf_overrides_temp + run_once: true + +- name: get rendered ceph_conf_overrides + local_action: set_fact ceph_conf_overrides_rendered="{{ lookup('template', '/tmp/ceph_conf_overrides_temp') | from_yaml }}" + run_once: true + - name: "generate ceph configuration file: {{ cluster }}.conf" action: config_template args: @@ -18,7 +26,7 @@ owner: "ceph" group: "ceph" mode: "0644" - config_overrides: "{{ ceph_conf_overrides }}" + config_overrides: "{{ ceph_conf_overrides_rendered }}" config_type: ini - name: assemble {{ cluster }}.conf and fragments