]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
ceph-common: do not get current fsid when performing a rolling_update
authorAndrew Schoen <aschoen@redhat.com>
Fri, 17 Feb 2017 20:29:45 +0000 (14:29 -0600)
committerAndrew Schoen <aschoen@redhat.com>
Tue, 21 Feb 2017 18:31:26 +0000 (12:31 -0600)
This avoids a situation where during a rolling_update we try to talk to
a mon to get the fsid and if that mon is down the playbook hangs
indefinitely.

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
roles/ceph-common/defaults/main.yml
roles/ceph-common/tasks/facts.yml

index 0573d901726472fb9b6c79f49ad88b9fc9a29f6a..b1905f78b45e31d93151f016b1c8240e34cf65bb 100644 (file)
@@ -401,3 +401,7 @@ mon_containerized_default_ceph_conf_with_kv: false
 nfs_file_gw: true
 # Set this to true to enable Object access via NFS. Requires an RGW role.
 nfs_obj_gw: false
+
+# this is only here for usage with the rolling_update.yml playbook
+# do not ever change this here
+rolling_update: false
index 6a05cc09739dbe4e12085ebebe700631986a65e7..0e444e00ff45890011d9facfd222d11fa5c3e25a 100644 (file)
@@ -5,6 +5,9 @@
   always_run: yes
   register: ceph_version
 
+# this task shouldn't run in a rolling_update situation
+# because it blindly picks a mon, which may be down because
+# of the rolling update
 - name: is ceph running already?
   command: ceph --connect-timeout 3 --cluster {{ cluster }} fsid
   changed_when: false
   always_run: yes
   register: ceph_current_fsid
   delegate_to: "{{ groups[mon_group_name][0] }}"
+  when: not rolling_update
+
+# set this as a default when performing a rolling_update
+# so the rest of the tasks here will succeed
+- set_fact:
+    ceph_current_fsid:
+      rc: 1
+  when: rolling_update
 
 - name: create a local fetch directory if it does not exist
   local_action: file path={{ fetch_directory }} state=directory
@@ -22,7 +33,8 @@
 
 - set_fact:
     fsid: "{{ ceph_current_fsid.stdout }}"
-  when: ceph_current_fsid.rc == 0
+  when:
+    - ceph_current_fsid.rc == 0
 
 - set_fact:
     monitor_name: "{{ ansible_hostname }}"