From 9e3509f844513789eed0bdf0b6cc1cdad944b4d7 Mon Sep 17 00:00:00 2001 From: Francesco Pantano Date: Wed, 16 Dec 2020 18:09:23 +0100 Subject: [PATCH] Rely on the HOSTNAME var to resolve the mon container name We previously used the {{ ansible_hostname }} variable as a replacement for ${HOSTNAME} when the ceph-mon container name needed to be resolved during the FFU process. However, sounds like {{ ansible_hostname }} doesn't return the value of the delegated host [1]. The purpose of this change is to compute the hostname relying on the exported env var and it's supposed to fix the tls-everywhere use case (when a more complex domain is provided). [1] https://github.com/ansible/ansible/issues/14958 Closes-Bug: #1903537 Change-Id: I77e3e5e4336a5d3f76b10d09cf7034023fbec075 (cherry picked from commit 3e2371f71fe2f56c69065f613c2fc2473e88d5e1) --- deployment/ceph-ansible/ceph-osd.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployment/ceph-ansible/ceph-osd.yaml b/deployment/ceph-ansible/ceph-osd.yaml index aa22c57315..19af059f67 100644 --- a/deployment/ceph-ansible/ceph-osd.yaml +++ b/deployment/ceph-ansible/ceph-osd.yaml @@ -84,7 +84,7 @@ outputs: register: check_docker_cli check_mode: false - name: Set noout flag - shell: "{{ container_client }} exec -u root ceph-mon-{{ ansible_hostname }} ceph osd set {{ item }}" + shell: "{{ container_client }} exec -u root ceph-mon-${HOSTNAME%%.*} ceph osd set {{ item }}" become: true with_items: - noout @@ -111,7 +111,7 @@ outputs: list_concat: - {get_attr: [CephBase, role_data, post_upgrade_tasks]} - - name: Unset noout flag - shell: "{{ container_cli }} exec -u root ceph-mon-{{ ansible_hostname }} ceph osd unset {{ item }}" + shell: "{{ container_cli }} exec -u root ceph-mon-${HOSTNAME%%.*} ceph osd unset {{ item }}" with_items: - noout - norecover