From 875d7c96dd410653700b08ace5bff810d93b5921 Mon Sep 17 00:00:00 2001 From: Christian Berendt Date: Fri, 20 Sep 2024 17:32:32 +0200 Subject: [PATCH] Use fact for the hostname of the first ceph mon service (#495) Related to 807f10c016416307fc4e35770cc932db26b0658f Signed-off-by: Christian Berendt --- playbooks/ceph/validate-ceph-osds.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/playbooks/ceph/validate-ceph-osds.yml b/playbooks/ceph/validate-ceph-osds.yml index fe06f62..3d5712e 100644 --- a/playbooks/ceph/validate-ceph-osds.yml +++ b/playbooks/ceph/validate-ceph-osds.yml @@ -343,9 +343,14 @@ _osds_test_up_in_result: "no-result" _osds_test_up_in_data: "" + - name: Set _mon_hostname fact + ansible.builtin.set_fact: + _mon_hostname: "{{ hostvars[groups[mon_group_name | default('ceph-mon')][0]]['ansible_hostname'] }}" + run_once: true + - name: Get ceph osd tree community.docker.docker_container_exec: - container: "ceph-mon-{{ ansible_hostname }}" + container: "ceph-mon-{{ _mon_hostname }}" command: "ceph osd tree --format=json" register: _osds_tree_raw run_once: true