2019-10-10 01:58:33 +08:00
|
|
|
---
|
|
|
|
- name: set _rbd_target_api_handler_called before restart
|
|
|
|
set_fact:
|
|
|
|
_rbd_target_api_handler_called: True
|
|
|
|
|
|
|
|
- name: restart rbd-target-api
|
2020-07-22 03:22:26 +08:00
|
|
|
service:
|
|
|
|
name: rbd-target-api
|
|
|
|
state: restarted
|
2019-10-10 01:58:33 +08:00
|
|
|
when:
|
|
|
|
- ceph_rbd_target_api_stat.get('rc') == 0
|
|
|
|
- hostvars[item]['_rbd_target_api_handler_called'] | default(False) | bool
|
|
|
|
- ceph_rbd_target_api_stat.get('stdout_lines', [])|length != 0
|
|
|
|
with_items: "{{ groups[iscsi_gw_group_name] }}"
|
|
|
|
delegate_to: "{{ item }}"
|
|
|
|
run_once: True
|
|
|
|
|
|
|
|
- name: set _rbd_target_api_handler_called after restart
|
|
|
|
set_fact:
|
|
|
|
_rbd_target_api_handler_called: False
|
2019-10-10 04:50:09 +08:00
|
|
|
|
|
|
|
- name: set _rbd_target_gw_handler_called before restart
|
|
|
|
set_fact:
|
|
|
|
_rbd_target_gw_handler_called: True
|
|
|
|
|
|
|
|
- name: restart rbd-target-gw
|
2020-07-22 03:22:26 +08:00
|
|
|
service:
|
|
|
|
name: rbd-target-gw
|
|
|
|
state: restarted
|
2019-10-10 04:50:09 +08:00
|
|
|
when:
|
|
|
|
- ceph_rbd_target_gw_stat.get('rc') == 0
|
|
|
|
- hostvars[item]['_rbd_target_gw_handler_called'] | default(False) | bool
|
|
|
|
- ceph_rbd_target_gw_stat.get('stdout_lines', [])|length != 0
|
|
|
|
with_items: "{{ groups[iscsi_gw_group_name] }}"
|
|
|
|
delegate_to: "{{ item }}"
|
|
|
|
run_once: True
|
|
|
|
|
|
|
|
- name: set _rbd_target_gw_handler_called after restart
|
|
|
|
set_fact:
|
|
|
|
_rbd_target_gw_handler_called: False
|