From f049642efdc40cc6c5db2c1efd39203a3c12c109 Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Fri, 16 Feb 2018 15:35:18 +0100 Subject: [PATCH] variables: sync with `ansible_hostname` ansible fact MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit given that we rely in many place to the `{{ ansible_hostname }}` fact in ceph-ansible, we have to ensure `$HOSTNAME` will match it. That fact relies on a `uname -n` [1], then it splits the string by '.' and pick the first element. [1] https://github.com/ansible/ansible/blob/6e585bdf247439cc820921b9f57206afcef61f03/lib/ansible/module_utils/facts/system/platform.py#L51 Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1546127 Signed-off-by: Guillaume Abrioux --- ceph-releases/jewel/ubuntu/14.04/daemon/variables_entrypoint.sh | 2 +- .../luminous/ubuntu/16.04/daemon/variables_entrypoint.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ceph-releases/jewel/ubuntu/14.04/daemon/variables_entrypoint.sh b/ceph-releases/jewel/ubuntu/14.04/daemon/variables_entrypoint.sh index a269fcd53..e6d6c39d9 100755 --- a/ceph-releases/jewel/ubuntu/14.04/daemon/variables_entrypoint.sh +++ b/ceph-releases/jewel/ubuntu/14.04/daemon/variables_entrypoint.sh @@ -17,7 +17,7 @@ ALL_SCENARIOS="populate_kvstore mon osd osd_directory osd_directory_single osd_c : "${CEPH_CLUSTER_NETWORK:=${CEPH_PUBLIC_NETWORK}}" : "${CEPH_DAEMON:=${1}}" # default daemon to first argument : "${CEPH_GET_ADMIN_KEY:=0}" -: "${HOSTNAME:=$(hostname -s)}" +: "${HOSTNAME:=$(uname -n | cut -d'.' -f1)}" : "${MON_NAME:=${HOSTNAME}}" : "${MON_DATA_DIR:=/var/lib/ceph/mon/${CLUSTER}-${MON_NAME}}" : "${K8S_HOST_NETWORK:=0}" diff --git a/ceph-releases/luminous/ubuntu/16.04/daemon/variables_entrypoint.sh b/ceph-releases/luminous/ubuntu/16.04/daemon/variables_entrypoint.sh index 8282f29b5..eee4c3805 100755 --- a/ceph-releases/luminous/ubuntu/16.04/daemon/variables_entrypoint.sh +++ b/ceph-releases/luminous/ubuntu/16.04/daemon/variables_entrypoint.sh @@ -17,7 +17,7 @@ ALL_SCENARIOS="populate_kvstore mon osd osd_directory osd_directory_single osd_c : "${CEPH_CLUSTER_NETWORK:=${CEPH_PUBLIC_NETWORK}}" : "${CEPH_DAEMON:=${1}}" # default daemon to first argument : "${CEPH_GET_ADMIN_KEY:=0}" -: "${HOSTNAME:=$(uname -n)}" +: "${HOSTNAME:=$(uname -n | cut -d'.' -f1)}" : "${MON_NAME:=${HOSTNAME}}" : "${MON_DATA_DIR:=/var/lib/ceph/mon/${CLUSTER}-${MON_NAME}}" : "${K8S_HOST_NETWORK:=0}"