From d5974086dded8c3bd4a08efaf3a7e603ff14427f Mon Sep 17 00:00:00 2001 From: Dimitri Savineau Date: Tue, 21 Jul 2020 15:27:59 -0400 Subject: [PATCH] ceph-facts: remove mds_name fact The mds_name fact always gets the ansible_hostname value so we don't need to have a dedicated fact for this and use the ansible_hostname fact instead. Signed-off-by: Dimitri Savineau (cherry picked from commit 4e84b4beedc54b94c0263212a926a1919c329b91) --- roles/ceph-facts/tasks/facts.yml | 4 ---- roles/ceph-handler/templates/restart_mds_daemon.sh.j2 | 2 +- roles/ceph-mds/tasks/common.yml | 2 +- roles/ceph-mds/tasks/non_containerized.yml | 8 ++++---- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/roles/ceph-facts/tasks/facts.yml b/roles/ceph-facts/tasks/facts.yml index 23ff27fed..cddbfa74a 100644 --- a/roles/ceph-facts/tasks/facts.yml +++ b/roles/ceph-facts/tasks/facts.yml @@ -172,10 +172,6 @@ set_fact: fsid: "{{ cluster_uuid.stdout }}" -- name: set_fact mds_name ansible_hostname - set_fact: - mds_name: "{{ ansible_hostname }}" - - name: resolve device link(s) command: readlink -f {{ item }} changed_when: false diff --git a/roles/ceph-handler/templates/restart_mds_daemon.sh.j2 b/roles/ceph-handler/templates/restart_mds_daemon.sh.j2 index b40d579b2..66038a443 100644 --- a/roles/ceph-handler/templates/restart_mds_daemon.sh.j2 +++ b/roles/ceph-handler/templates/restart_mds_daemon.sh.j2 @@ -2,7 +2,7 @@ RETRIES="{{ handler_health_mds_check_retries }}" DELAY="{{ handler_health_mds_check_delay }}" -MDS_NAME="{{ mds_name }}" +MDS_NAME="{{ ansible_hostname }}" {% if containerized_deployment %} DOCKER_EXEC="{{ container_binary }} exec ceph-mds-{{ ansible_hostname }}" {% endif %} diff --git a/roles/ceph-mds/tasks/common.yml b/roles/ceph-mds/tasks/common.yml index c9df2017d..1d5364a70 100644 --- a/roles/ceph-mds/tasks/common.yml +++ b/roles/ceph-mds/tasks/common.yml @@ -8,7 +8,7 @@ mode: "{{ ceph_directories_mode }}" with_items: - /var/lib/ceph/bootstrap-mds/ - - /var/lib/ceph/mds/{{ cluster }}-{{ mds_name }} + - /var/lib/ceph/mds/{{ cluster }}-{{ ansible_hostname }} - name: get keys from monitors command: "{{ container_exec_cmd | default('') }} ceph --cluster {{ cluster }} auth get {{ item.name }}" diff --git a/roles/ceph-mds/tasks/non_containerized.yml b/roles/ceph-mds/tasks/non_containerized.yml index a4400172a..a3bef65ab 100644 --- a/roles/ceph-mds/tasks/non_containerized.yml +++ b/roles/ceph-mds/tasks/non_containerized.yml @@ -21,15 +21,15 @@ - ansible_os_family in ['Suse', 'RedHat'] - name: create mds keyring - command: ceph --cluster {{ cluster }} --name client.bootstrap-mds --keyring /var/lib/ceph/bootstrap-mds/{{ cluster }}.keyring auth get-or-create mds.{{ mds_name }} osd 'allow rwx' mds 'allow' mon 'allow profile mds' -o /var/lib/ceph/mds/{{ cluster }}-{{ mds_name }}/keyring + command: ceph --cluster {{ cluster }} --name client.bootstrap-mds --keyring /var/lib/ceph/bootstrap-mds/{{ cluster }}.keyring auth get-or-create mds.{{ ansible_hostname }} osd 'allow rwx' mds 'allow' mon 'allow profile mds' -o /var/lib/ceph/mds/{{ cluster }}-{{ ansible_hostname }}/keyring args: - creates: /var/lib/ceph/mds/{{ cluster }}-{{ mds_name }}/keyring + creates: /var/lib/ceph/mds/{{ cluster }}-{{ ansible_hostname }}/keyring changed_when: false when: cephx - name: set mds key permissions file: - path: /var/lib/ceph/mds/{{ cluster }}-{{ mds_name }}/keyring + path: /var/lib/ceph/mds/{{ cluster }}-{{ ansible_hostname }}/keyring owner: "ceph" group: "ceph" mode: "0600" @@ -55,7 +55,7 @@ - name: start and add that the metadata service to the init sequence service: - name: ceph-mds@{{ mds_name }} + name: ceph-mds@{{ ansible_hostname }} state: started enabled: yes masked: no