]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
ceph-facts: remove mds_name fact
authorDimitri Savineau <dsavinea@redhat.com>
Tue, 21 Jul 2020 19:27:59 +0000 (15:27 -0400)
committerDimitri Savineau <savineau.dimitri@gmail.com>
Fri, 24 Jul 2020 14:50:44 +0000 (10:50 -0400)
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 <dsavinea@redhat.com>
(cherry picked from commit 4e84b4beedc54b94c0263212a926a1919c329b91)

roles/ceph-facts/tasks/facts.yml
roles/ceph-handler/templates/restart_mds_daemon.sh.j2
roles/ceph-mds/tasks/common.yml
roles/ceph-mds/tasks/non_containerized.yml

index 23ff27fed9b95d67b70550c6e8e21ad48e51e627..cddbfa74a878758e56d5c5a745a662e9fb3a3018 100644 (file)
     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
index b40d579b27b8caf8d4112929a5878549d0b37712..66038a443f6aedcaefc6e9ec590c0151bb967dbf 100644 (file)
@@ -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 %}
index c9df2017dd6caa8eac65b9ba7fc38d2c8f96953c..1d5364a703dfa567584e3aaccaf1f813535119f9 100644 (file)
@@ -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 }}"
index a4400172aafa49c2233b965ec4b55bb04af40d8e..a3bef65abd8dab3c3e5d4173c3bce753089e9b56 100644 (file)
     - 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