From 894df4b8c8dafe840555121ddbd4b33f21228f60 Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Fri, 2 Jun 2017 10:06:19 +0200 Subject: [PATCH] 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 --- roles/ceph-common/tasks/generate_ceph_conf.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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