From f46217b69ae18317cb0c1cc3e391a0bca5767eb6 Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Wed, 10 Jan 2018 10:18:27 +0100 Subject: [PATCH] containers: fix bug when looking for existing cluster MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When containerized deployment, `docker_exec_cmd` is not set before the task which try to retrieve the current fsid is played, it means it considers there is no existing fsid and try to generate a new one. Typical error: ``` ok: [mon0 -> mon0] => { "changed": false, "cmd": [ "ceph", "--connect-timeout", "3", "--cluster", "test", "fsid" ], "delta": "0:00:00.179909", "end": "2018-01-09 10:36:58.759846", "failed": false, "failed_when_result": false, "rc": 1, "start": "2018-01-09 10:36:58.579937" } STDERR: Error initializing cluster client: Error('error calling conf_read_file: errno EINVAL',) ``` Signed-off-by: Guillaume Abrioux (cherry picked from commit 900f447c82c722539c6eed74c98bf1988a001b3d) Signed-off-by: Sébastien Han --- roles/ceph-defaults/tasks/facts.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/roles/ceph-defaults/tasks/facts.yml b/roles/ceph-defaults/tasks/facts.yml index 0bf156831..7b5edfa21 100644 --- a/roles/ceph-defaults/tasks/facts.yml +++ b/roles/ceph-defaults/tasks/facts.yml @@ -11,6 +11,13 @@ when: - mon_use_fqdn +- name: set_fact docker_exec_cmd + set_fact: + docker_exec_cmd: "docker exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }}" + delegate_to: "{{ groups[mon_group_name][0] }}" + when: + - containerized_deployment + # this task shouldn't run in a rolling_update situation # because it blindly picks a mon, which may be down because # of the rolling update