From 3f67741768a8084b2c9fa232530248d4737b3509 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Mon, 9 May 2016 00:36:15 +0200 Subject: [PATCH] ceph-mds: fix the handler MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Moving the mds_name fact in the common role so the MDS can properly be restarted. Signed-off-by: Sébastien Han (cherry picked from commit b3971354bf69e30fa63e400e4161f842e5d82379) --- group_vars/all.sample | 2 ++ group_vars/common-coreoss.sample | 1 - roles/ceph-common/tasks/facts.yml | 9 +++++++++ roles/ceph-mds/tasks/pre_requisite.yml | 8 -------- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/group_vars/all.sample b/group_vars/all.sample index c903429452..e1324c5f70 100644 --- a/group_vars/all.sample +++ b/group_vars/all.sample @@ -303,6 +303,7 @@ dummy: ## MDS options # #mds_use_fqdn: false # if set to true, the MDS name used will be the fqdn in the ceph.conf +#mds_name: "{{ ansible_hostname }}" ## Rados Gateway options # @@ -380,3 +381,4 @@ dummy: # by ceph.conf.j2 template. so it should always be defined #mon_containerized_deployment_with_kv: false + diff --git a/group_vars/common-coreoss.sample b/group_vars/common-coreoss.sample index 32ae295533..071f0af9e7 100644 --- a/group_vars/common-coreoss.sample +++ b/group_vars/common-coreoss.sample @@ -14,4 +14,3 @@ dummy: #pypy_binary_directory: /opt/bin #pip_url: https://bootstrap.pypa.io/get-pip.py #local_temp_directory: /tmp - diff --git a/roles/ceph-common/tasks/facts.yml b/roles/ceph-common/tasks/facts.yml index d65fa2f363..b1cd054f58 100644 --- a/roles/ceph-common/tasks/facts.yml +++ b/roles/ceph-common/tasks/facts.yml @@ -61,3 +61,12 @@ - set_fact: is_kraken={{ ceph_version | version_compare('11.0.0', '>=') and ceph_version | version_compare('12.0.0', '<') }} + +- set_fact: + mds_name: "{{ ansible_hostname }}" + when: not mds_use_fqdn + +- set_fact: + mds_name: "{{ ansible_fqdn }}" + when: mds_use_fqdn + diff --git a/roles/ceph-mds/tasks/pre_requisite.yml b/roles/ceph-mds/tasks/pre_requisite.yml index cd16d76fa2..4b24ea5e02 100644 --- a/roles/ceph-mds/tasks/pre_requisite.yml +++ b/roles/ceph-mds/tasks/pre_requisite.yml @@ -1,12 +1,4 @@ --- -- set_fact: - mds_name: "{{ ansible_hostname }}" - when: not mds_use_fqdn - -- set_fact: - mds_name: "{{ ansible_fqdn }}" - when: mds_use_fqdn - - name: create bootstrap-mds directory file: path: /var/lib/ceph/bootstrap-mds/