From: Dimitri Savineau Date: Wed, 29 Jan 2020 02:34:24 +0000 (-0500) Subject: ceph-facts: fix _container_exec_cmd fact value X-Git-Tag: v4.0.14 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9da917501b7acc2659c4cffb2ef75f6a76cc9aaf;p=ceph-ansible.git ceph-facts: fix _container_exec_cmd fact value When using different name between the inventory_hostname and the ansible_hostname then the _container_exec_cmd fact will get a wrong value based on the inventory_hostname instead of the ansible_hostname. This happens when the ceph cluster is already running (update/upgrade). Later the container exec commands will fail because the container name is wrong. We should always set the _container_exec_cmd based on the ansible_hostname fact. Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1795792 Signed-off-by: Dimitri Savineau (cherry picked from commit 1fcafffdad43476d1d99766a57b4087cfe43718b) --- diff --git a/roles/ceph-facts/tasks/facts.yml b/roles/ceph-facts/tasks/facts.yml index 152414d02..8d27812bb 100644 --- a/roles/ceph-facts/tasks/facts.yml +++ b/roles/ceph-facts/tasks/facts.yml @@ -102,7 +102,7 @@ - name: set_fact _container_exec_cmd set_fact: - _container_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] if running_mon is undefined else running_mon }}" + _container_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0] if running_mon is undefined else running_mon]['ansible_hostname'] }}" when: - containerized_deployment | bool