mirror of https://github.com/ceph/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 <dsavinea@redhat.com>pull/5008/head
parent
a27290bf98
commit
1fcafffdad
|
@ -96,7 +96,7 @@
|
||||||
|
|
||||||
- name: set_fact _container_exec_cmd
|
- name: set_fact _container_exec_cmd
|
||||||
set_fact:
|
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:
|
when:
|
||||||
- containerized_deployment | bool
|
- containerized_deployment | bool
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue