From: Andrew Schoen Date: Fri, 17 Feb 2017 20:29:45 +0000 (-0600) Subject: ceph-common: do not get current fsid when performing a rolling_update X-Git-Tag: v2.2.0rc1~22^2~4 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=1579642e3f2bbf2fb830858e1c4fd28490654de0;p=ceph-ansible.git ceph-common: do not get current fsid when performing a rolling_update 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 --- diff --git a/roles/ceph-common/defaults/main.yml b/roles/ceph-common/defaults/main.yml index 0573d9017..b1905f78b 100644 --- a/roles/ceph-common/defaults/main.yml +++ b/roles/ceph-common/defaults/main.yml @@ -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 diff --git a/roles/ceph-common/tasks/facts.yml b/roles/ceph-common/tasks/facts.yml index 6a05cc097..0e444e00f 100644 --- a/roles/ceph-common/tasks/facts.yml +++ b/roles/ceph-common/tasks/facts.yml @@ -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 @@ -12,6 +15,14 @@ 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 }}"