]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
handler: add serial restart back 2009/head
authorSébastien Han <seb@redhat.com>
Fri, 6 Oct 2017 23:23:30 +0000 (01:23 +0200)
committerSébastien Han <seb@redhat.com>
Sat, 7 Oct 2017 01:39:10 +0000 (03:39 +0200)
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 <seb@redhat.com>
roles/ceph-defaults/handlers/main.yml

index 36edca8292aac24ac37f3f0398dfb2bfaebd1aa8..e0e9ca4e49d27ddad351028288ac9452c5678c8a 100644 (file)
@@ -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:
     - 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
     - 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:
     - 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
     - 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:
     - 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
     - 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:
     - 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
     - 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:
     - 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
     - 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 }}"