]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
facts: retrieve fsid during rolling_update playbook
authorGuillaume Abrioux <gabrioux@redhat.com>
Wed, 20 Mar 2019 17:34:47 +0000 (18:34 +0100)
committerDimitri Savineau <savineau.dimitri@gmail.com>
Mon, 25 Mar 2019 20:02:56 +0000 (16:02 -0400)
otherwise it generates a new cluster fsid and makes the upgrade failing

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
roles/ceph-facts/tasks/facts.yml

index bbb041a86052eb03b53942d3ca79cbea98cd4370..58ee121a901f61fa4a4f116a3bd3aed7b04a10a5 100644 (file)
   when:
     - (cephx or generate_fsid)
 
+- name: get current fsid
+  command: "{{ timeout_command }} {{ docker_exec_cmd }} ceph --cluster {{ cluster }} daemon mon.{{ hostvars[mon_host | default(groups[mon_group_name][0])]['ansible_hostname'] }} config get fsid"
+  register: rolling_update_fsid
+  delegate_to: "{{ mon_host | default(groups[mon_group_name][0]) }}"
+  when:
+    - rolling_update
+
+- name: set_fact fsid
+  set_fact:
+    fsid: "{{ (rolling_update_fsid.stdout | from_json).fsid }}"
+  when:
+    - rolling_update
+
 - name: set_fact ceph_current_status (convert to json)
   set_fact:
     ceph_current_status: "{{ ceph_current_status.stdout | from_json }}"
   when:
     - generate_fsid
     - ceph_current_status.fsid is undefined
+    - not rolling_update
 
 - name: set_fact mds_name ansible_hostname
   set_fact: