From 9f1bd3d6dd16e96b0276270997eceacc2cad9f88 Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Han?= Date: Sat, 7 Oct 2017 01:23:30 +0200 Subject: [PATCH] handler: add serial restart back MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit We now restart daemons on each machine in a serialized fashion. Closes: https://github.com/ceph/ceph-ansible/issues/1989 Signed-off-by: Sébastien Han --- roles/ceph-defaults/handlers/main.yml | 42 +++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/roles/ceph-defaults/handlers/main.yml b/roles/ceph-defaults/handlers/main.yml index 36edca829..e0e9ca4e4 100644 --- a/roles/ceph-defaults/handlers/main.yml +++ b/roles/ceph-defaults/handlers/main.yml @@ -25,6 +25,9 @@ - mon_group_name in group_names - not containerized_deployment - mon_socket_stat.rc == 0 + with_items: "{{ ansible_play_batch }}" + run_once: true + delegate_to: "{{ item }}" - name: restart ceph mon daemon(s) - container command: /tmp/restart_mon_daemon.sh @@ -34,6 +37,9 @@ - mon_group_name in group_names - containerized_deployment - ceph_mon_container_stat.get('stdout_lines', [])|length != 0 + with_items: "{{ ansible_play_batch }}" + run_once: true + delegate_to: "{{ item }}" # This does not just restart OSDs but everything else too. Unfortunately # at this time the ansible role does not have an OSD id list to use @@ -63,6 +69,9 @@ - handler_health_osd_check # See https://github.com/ceph/ceph-ansible/issues/1457 for the condition below - inventory_hostname in play_hosts + with_items: "{{ ansible_play_batch }}" + run_once: true + delegate_to: "{{ item }}" - name: restart ceph osds daemon(s) - container command: /tmp/restart_osd_daemon.sh @@ -76,6 +85,9 @@ - handler_health_osd_check # See https://github.com/ceph/ceph-ansible/issues/1457 for the condition below - inventory_hostname in play_hosts + with_items: "{{ ansible_play_batch }}" + run_once: true + delegate_to: "{{ item }}" - name: copy mds restart script template: @@ -97,6 +109,9 @@ - mds_group_name in group_names - not containerized_deployment - mds_socket_stat.rc == 0 + with_items: "{{ ansible_play_batch }}" + run_once: true + delegate_to: "{{ item }}" - name: restart ceph mds daemon(s) - container command: /tmp/restart_mds_daemon.sh @@ -106,6 +121,9 @@ - mds_group_name in group_names - containerized_deployment - ceph_mds_container_stat.get('stdout_lines', [])|length != 0 + with_items: "{{ ansible_play_batch }}" + run_once: true + delegate_to: "{{ item }}" - name: copy rgw restart script template: @@ -127,6 +145,9 @@ - rgw_group_name in group_names - not containerized_deployment - rgw_socket_stat.rc == 0 + with_items: "{{ ansible_play_batch }}" + run_once: true + delegate_to: "{{ item }}" - name: restart ceph rgw daemon(s) - container command: /tmp/restart_rgw_daemon.sh @@ -136,6 +157,9 @@ - rgw_group_name in group_names - containerized_deployment - ceph_rgw_container_stat.get('stdout_lines', [])|length != 0 + with_items: "{{ ansible_play_batch }}" + run_once: true + delegate_to: "{{ item }}" - name: copy nfs restart script template: @@ -157,6 +181,9 @@ - nfs_group_name in group_names - not containerized_deployment - nfs_socket_stat.rc == 0 + with_items: "{{ ansible_play_batch }}" + run_once: true + delegate_to: "{{ item }}" - name: restart ceph nfs daemon(s) - container command: /tmp/restart_nfs_daemon.sh @@ -166,6 +193,9 @@ - nfs_group_name in group_names - containerized_deployment - ceph_nfs_container_stat.get('stdout_lines', [])|length != 0 + with_items: "{{ ansible_play_batch }}" + run_once: true + delegate_to: "{{ item }}" - name: copy rbd mirror restart script template: @@ -187,6 +217,9 @@ - rbdmirror_group_name in group_names - not containerized_deployment - rbd_mirror_socket_stat.rc == 0 + with_items: "{{ ansible_play_batch }}" + run_once: true + delegate_to: "{{ item }}" - name: restart ceph rbd mirror daemon(s) - container command: /tmp/restart_rbd_mirror_daemon.sh @@ -196,6 +229,9 @@ - rbdmirror_group_name in group_names - containerized_deployment - ceph_rbd_mirror_container_stat.get('stdout_lines', [])|length != 0 + with_items: "{{ ansible_play_batch }}" + run_once: true + delegate_to: "{{ item }}" - name: copy mgr restart script template: @@ -217,6 +253,9 @@ - mgr_group_name in group_names - not containerized_deployment - mgr_socket_stat.rc == 0 + with_items: "{{ ansible_play_batch }}" + run_once: true + delegate_to: "{{ item }}" - name: restart ceph mgr daemon(s) - container command: /tmp/restart_mgr_daemon.sh @@ -226,3 +265,6 @@ - mgr_group_name in group_names - containerized_deployment - ceph_mgr_container_stat.get('stdout_lines', [])|length != 0 + with_items: "{{ ansible_play_batch }}" + run_once: true + delegate_to: "{{ item }}" -- 2.47.3