2014-03-04 02:08:51 +08:00
|
|
|
---
|
2014-09-05 03:14:11 +08:00
|
|
|
- name: update apt cache
|
2015-09-04 00:18:53 +08:00
|
|
|
apt:
|
|
|
|
update-cache: yes
|
2017-09-15 06:48:53 +08:00
|
|
|
when:
|
|
|
|
- ansible_os_family == 'Debian'
|
2014-03-04 02:08:51 +08:00
|
|
|
|
2017-12-20 11:49:16 +08:00
|
|
|
# We only want to restart on hosts that have called the handler.
|
|
|
|
# This var is set when he handler is called, and unset after the
|
|
|
|
# restart to ensure only the correct hosts are restarted.
|
|
|
|
- name: set _mon_handler_called before restart
|
|
|
|
set_fact:
|
|
|
|
_mon_handler_called: True
|
|
|
|
listen: "restart ceph mons"
|
|
|
|
|
2017-09-28 00:22:15 +08:00
|
|
|
- name: copy mon restart script
|
|
|
|
template:
|
|
|
|
src: restart_mon_daemon.sh.j2
|
|
|
|
dest: /tmp/restart_mon_daemon.sh
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0750
|
|
|
|
listen: "restart ceph mons"
|
|
|
|
when:
|
|
|
|
- mon_group_name in group_names
|
|
|
|
|
|
|
|
- name: restart ceph mon daemon(s) - non container
|
2017-11-06 22:02:47 +08:00
|
|
|
command: /usr/bin/env bash /tmp/restart_mon_daemon.sh
|
2017-09-28 00:22:15 +08:00
|
|
|
listen: "restart ceph mons"
|
2017-04-04 01:55:11 +08:00
|
|
|
when:
|
2017-08-31 17:22:33 +08:00
|
|
|
# We do not want to run these checks on initial deployment (`socket.rc == 0`)
|
2017-04-04 01:55:11 +08:00
|
|
|
- mon_group_name in group_names
|
2017-09-28 00:22:15 +08:00
|
|
|
- not containerized_deployment
|
2017-12-20 11:49:16 +08:00
|
|
|
- hostvars[item]['_mon_handler_called'] | default(False)
|
2017-09-27 06:55:31 +08:00
|
|
|
- mon_socket_stat.rc == 0
|
2017-10-17 21:54:17 +08:00
|
|
|
with_items: "{{ groups[mon_group_name] }}"
|
2017-10-07 07:23:30 +08:00
|
|
|
delegate_to: "{{ item }}"
|
2017-12-20 11:49:16 +08:00
|
|
|
run_once: True
|
2017-04-04 01:55:11 +08:00
|
|
|
|
2017-09-28 00:22:15 +08:00
|
|
|
- name: restart ceph mon daemon(s) - container
|
2017-11-06 22:02:47 +08:00
|
|
|
command: /usr/bin/env bash /tmp/restart_mon_daemon.sh
|
2017-09-28 00:22:15 +08:00
|
|
|
listen: "restart ceph mons"
|
|
|
|
when:
|
|
|
|
# We do not want to run these checks on initial deployment (`socket.rc == 0`)
|
|
|
|
- mon_group_name in group_names
|
|
|
|
- containerized_deployment
|
2017-11-27 21:59:30 +08:00
|
|
|
- ceph_mon_container_stat.get('rc') == 0
|
2017-12-20 11:49:16 +08:00
|
|
|
- hostvars[item]['_mon_handler_called'] | default(False)
|
2017-10-06 22:49:46 +08:00
|
|
|
- ceph_mon_container_stat.get('stdout_lines', [])|length != 0
|
2017-10-17 21:54:17 +08:00
|
|
|
with_items: "{{ groups[mon_group_name] }}"
|
2017-10-07 07:23:30 +08:00
|
|
|
delegate_to: "{{ item }}"
|
2017-12-20 11:49:16 +08:00
|
|
|
run_once: True
|
|
|
|
|
|
|
|
- name: set _mon_handler_called after restart
|
|
|
|
set_fact:
|
|
|
|
_mon_handler_called: False
|
|
|
|
listen: "restart ceph mons"
|
|
|
|
|
|
|
|
- name: set _osd_handler_called before restart
|
|
|
|
set_fact:
|
|
|
|
_osd_handler_called: True
|
|
|
|
listen: "restart ceph osds"
|
2017-09-28 00:22:15 +08:00
|
|
|
|
2017-04-04 01:55:11 +08:00
|
|
|
# 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
|
|
|
|
# for restarting them specifically.
|
2018-03-17 01:10:14 +08:00
|
|
|
# This does not need to run during a rolling update as the playbook will
|
|
|
|
# restart all OSDs using the tasks "start ceph osd" or
|
|
|
|
# "restart containerized ceph osd"
|
2017-07-29 07:00:06 +08:00
|
|
|
- name: copy osd restart script
|
|
|
|
template:
|
|
|
|
src: restart_osd_daemon.sh.j2
|
|
|
|
dest: /tmp/restart_osd_daemon.sh
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0750
|
|
|
|
listen: "restart ceph osds"
|
|
|
|
when:
|
|
|
|
- osd_group_name in group_names
|
2018-03-17 01:10:14 +08:00
|
|
|
- not rolling_update
|
2017-04-04 01:55:11 +08:00
|
|
|
|
2017-09-28 00:22:15 +08:00
|
|
|
- name: restart ceph osds daemon(s) - non container
|
2017-11-06 22:02:47 +08:00
|
|
|
command: /usr/bin/env bash /tmp/restart_osd_daemon.sh
|
2017-07-29 07:00:06 +08:00
|
|
|
listen: "restart ceph osds"
|
|
|
|
when:
|
2017-09-27 06:55:31 +08:00
|
|
|
- osd_group_name in group_names
|
2017-09-28 00:22:15 +08:00
|
|
|
- not containerized_deployment
|
2018-03-17 01:10:14 +08:00
|
|
|
- not rolling_update
|
2017-09-28 00:22:15 +08:00
|
|
|
# We do not want to run these checks on initial deployment (`socket_osd_container.results[n].rc == 0`)
|
|
|
|
# except when a crush location is specified. ceph-disk will start the osds before the osd crush location is specified
|
2018-02-21 22:56:32 +08:00
|
|
|
- osd_socket_stat.rc == 0
|
2018-08-22 02:50:31 +08:00
|
|
|
- ceph_current_status.fsid is defined
|
2017-07-29 07:00:06 +08:00
|
|
|
- handler_health_osd_check
|
2017-12-20 11:49:16 +08:00
|
|
|
- hostvars[item]['_osd_handler_called'] | default(False)
|
2017-10-17 21:54:17 +08:00
|
|
|
with_items: "{{ groups[osd_group_name] }}"
|
2017-10-07 07:23:30 +08:00
|
|
|
delegate_to: "{{ item }}"
|
2017-12-20 11:49:16 +08:00
|
|
|
run_once: True
|
2017-04-18 18:40:43 +08:00
|
|
|
|
2017-09-28 00:22:15 +08:00
|
|
|
- name: restart ceph osds daemon(s) - container
|
2017-11-06 22:02:47 +08:00
|
|
|
command: /usr/bin/env bash /tmp/restart_osd_daemon.sh
|
2017-07-29 07:00:06 +08:00
|
|
|
listen: "restart ceph osds"
|
2017-04-04 01:55:11 +08:00
|
|
|
when:
|
2017-09-28 00:22:15 +08:00
|
|
|
# We do not want to run these checks on initial deployment (`socket_osd_container_stat.results[n].rc == 0`)
|
2017-08-31 17:22:33 +08:00
|
|
|
# except when a crush location is specified. ceph-disk will start the osds before the osd crush location is specified
|
2017-09-28 00:22:15 +08:00
|
|
|
- osd_group_name in group_names
|
|
|
|
- containerized_deployment
|
2018-03-17 01:10:14 +08:00
|
|
|
- not rolling_update
|
2018-02-21 22:56:32 +08:00
|
|
|
- inventory_hostname == groups.get(osd_group_name) | last
|
2018-10-13 16:42:18 +08:00
|
|
|
- ceph_osd_container_stat.get('rc') == 0
|
2018-02-21 22:56:32 +08:00
|
|
|
- ceph_osd_container_stat.get('stdout_lines', [])|length != 0
|
2017-07-29 07:00:06 +08:00
|
|
|
- handler_health_osd_check
|
2017-12-20 11:49:16 +08:00
|
|
|
- hostvars[item]['_osd_handler_called'] | default(False)
|
2017-10-17 21:54:17 +08:00
|
|
|
with_items: "{{ groups[osd_group_name] }}"
|
2017-10-07 07:23:30 +08:00
|
|
|
delegate_to: "{{ item }}"
|
2017-12-20 11:49:16 +08:00
|
|
|
run_once: True
|
|
|
|
|
|
|
|
- name: set _osd_handler_called after restart
|
|
|
|
set_fact:
|
|
|
|
_osd_handler_called: False
|
|
|
|
listen: "restart ceph osds"
|
|
|
|
|
|
|
|
- name: set _mds_handler_called before restart
|
|
|
|
set_fact:
|
|
|
|
_mds_handler_called: True
|
|
|
|
listen: "restart ceph mdss"
|
2015-07-01 00:07:03 +08:00
|
|
|
|
2017-09-28 00:22:15 +08:00
|
|
|
- name: copy mds restart script
|
|
|
|
template:
|
|
|
|
src: restart_mds_daemon.sh.j2
|
|
|
|
dest: /tmp/restart_mds_daemon.sh
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0750
|
|
|
|
listen: "restart ceph mdss"
|
|
|
|
when:
|
|
|
|
- mds_group_name in group_names
|
|
|
|
|
|
|
|
- name: restart ceph mds daemon(s) - non container
|
2017-11-06 22:02:47 +08:00
|
|
|
command: /usr/bin/env bash /tmp/restart_mds_daemon.sh
|
2017-09-28 00:22:15 +08:00
|
|
|
listen: "restart ceph mdss"
|
2017-08-31 17:22:33 +08:00
|
|
|
when:
|
|
|
|
# We do not want to run these checks on initial deployment (`socket.rc == 0`)
|
|
|
|
- mds_group_name in group_names
|
2017-09-28 00:22:15 +08:00
|
|
|
- not containerized_deployment
|
2017-12-20 11:49:16 +08:00
|
|
|
- hostvars[item]['_mds_handler_called'] | default(False)
|
2017-09-27 06:55:31 +08:00
|
|
|
- mds_socket_stat.rc == 0
|
2017-10-17 21:54:17 +08:00
|
|
|
with_items: "{{ groups[mds_group_name] }}"
|
2017-10-07 07:23:30 +08:00
|
|
|
delegate_to: "{{ item }}"
|
2017-12-20 11:49:16 +08:00
|
|
|
run_once: True
|
2017-08-31 17:22:33 +08:00
|
|
|
|
2017-09-28 00:22:15 +08:00
|
|
|
- name: restart ceph mds daemon(s) - container
|
2017-11-06 22:02:47 +08:00
|
|
|
command: /usr/bin/env bash /tmp/restart_mds_daemon.sh
|
2017-09-28 00:22:15 +08:00
|
|
|
listen: "restart ceph mdss"
|
|
|
|
when:
|
|
|
|
# We do not want to run these checks on initial deployment (`socket.rc == 0`)
|
|
|
|
- mds_group_name in group_names
|
|
|
|
- containerized_deployment
|
2017-11-27 21:59:30 +08:00
|
|
|
- ceph_mds_container_stat.get('rc') == 0
|
2017-12-20 11:49:16 +08:00
|
|
|
- hostvars[item]['_mds_handler_called'] | default(False)
|
2017-10-06 22:49:46 +08:00
|
|
|
- ceph_mds_container_stat.get('stdout_lines', [])|length != 0
|
2017-10-17 21:54:17 +08:00
|
|
|
with_items: "{{ groups[mds_group_name] }}"
|
2017-10-07 07:23:30 +08:00
|
|
|
delegate_to: "{{ item }}"
|
2017-12-20 11:49:16 +08:00
|
|
|
run_once: True
|
|
|
|
|
|
|
|
- name: set _mds_handler_called after restart
|
|
|
|
set_fact:
|
|
|
|
_mds_handler_called: False
|
|
|
|
listen: "restart ceph mdss"
|
|
|
|
|
|
|
|
- name: set _rgw_handler_called before restart
|
|
|
|
set_fact:
|
|
|
|
_rgw_handler_called: True
|
|
|
|
listen: "restart ceph rgws"
|
2017-09-28 00:22:15 +08:00
|
|
|
|
2017-08-31 17:22:33 +08:00
|
|
|
- name: copy rgw restart script
|
|
|
|
template:
|
|
|
|
src: restart_rgw_daemon.sh.j2
|
|
|
|
dest: /tmp/restart_rgw_daemon.sh
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0750
|
|
|
|
listen: "restart ceph rgws"
|
2017-04-04 01:55:11 +08:00
|
|
|
when:
|
2017-08-31 17:22:33 +08:00
|
|
|
- rgw_group_name in group_names
|
|
|
|
|
2017-09-28 00:22:15 +08:00
|
|
|
- name: restart ceph rgw daemon(s) - non container
|
2017-11-06 22:02:47 +08:00
|
|
|
command: /usr/bin/env bash /tmp/restart_rgw_daemon.sh
|
2017-08-31 17:22:33 +08:00
|
|
|
listen: "restart ceph rgws"
|
|
|
|
when:
|
|
|
|
# We do not want to run these checks on initial deployment (`socket.rc == 0`)
|
2017-04-04 01:55:11 +08:00
|
|
|
- rgw_group_name in group_names
|
2017-09-28 00:22:15 +08:00
|
|
|
- not containerized_deployment
|
2017-12-20 11:49:16 +08:00
|
|
|
- hostvars[item]['_rgw_handler_called'] | default(False)
|
2017-09-27 06:55:31 +08:00
|
|
|
- rgw_socket_stat.rc == 0
|
2017-10-17 21:54:17 +08:00
|
|
|
with_items: "{{ groups[rgw_group_name] }}"
|
2017-10-07 07:23:30 +08:00
|
|
|
delegate_to: "{{ item }}"
|
2017-12-20 11:49:16 +08:00
|
|
|
run_once: True
|
2015-08-03 23:39:57 +08:00
|
|
|
|
2017-09-28 00:22:15 +08:00
|
|
|
- name: restart ceph rgw daemon(s) - container
|
2017-11-06 22:02:47 +08:00
|
|
|
command: /usr/bin/env bash /tmp/restart_rgw_daemon.sh
|
2017-09-28 00:22:15 +08:00
|
|
|
listen: "restart ceph rgws"
|
|
|
|
when:
|
|
|
|
# We do not want to run these checks on initial deployment (`socket.rc == 0`)
|
|
|
|
- rgw_group_name in group_names
|
|
|
|
- containerized_deployment
|
2017-11-27 21:59:30 +08:00
|
|
|
- ceph_rgw_container_stat.get('rc') == 0
|
2017-12-20 11:49:16 +08:00
|
|
|
- hostvars[item]['_rgw_handler_called'] | default(False)
|
2017-10-06 22:49:46 +08:00
|
|
|
- ceph_rgw_container_stat.get('stdout_lines', [])|length != 0
|
2017-10-17 21:54:17 +08:00
|
|
|
with_items: "{{ groups[rgw_group_name] }}"
|
2017-10-07 07:23:30 +08:00
|
|
|
delegate_to: "{{ item }}"
|
2017-12-20 11:49:16 +08:00
|
|
|
run_once: True
|
|
|
|
|
|
|
|
- name: set _rgw_handler_called after restart
|
|
|
|
set_fact:
|
|
|
|
_rgw_handler_called: False
|
|
|
|
listen: "restart ceph rgws"
|
|
|
|
|
|
|
|
- name: set _nfs_handler_called before restart
|
|
|
|
set_fact:
|
|
|
|
_nfs_handler_called: True
|
|
|
|
listen: "restart ceph nfss"
|
2017-09-28 00:22:15 +08:00
|
|
|
|
2017-09-27 06:55:31 +08:00
|
|
|
- name: copy nfs restart script
|
|
|
|
template:
|
|
|
|
src: restart_nfs_daemon.sh.j2
|
|
|
|
dest: /tmp/restart_nfs_daemon.sh
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0750
|
|
|
|
listen: "restart ceph nfss"
|
|
|
|
when:
|
|
|
|
- nfs_group_name in group_names
|
|
|
|
|
2017-09-28 00:22:15 +08:00
|
|
|
- name: restart ceph nfs daemon(s) - non container
|
2017-11-06 22:02:47 +08:00
|
|
|
command: /usr/bin/env bash /tmp/restart_nfs_daemon.sh
|
2017-09-27 06:55:31 +08:00
|
|
|
listen: "restart ceph nfss"
|
2016-05-06 02:20:03 +08:00
|
|
|
when:
|
2017-09-27 06:55:31 +08:00
|
|
|
# We do not want to run these checks on initial deployment (`socket.rc == 0`)
|
2016-05-06 02:20:03 +08:00
|
|
|
- nfs_group_name in group_names
|
2017-09-28 00:22:15 +08:00
|
|
|
- not containerized_deployment
|
2017-12-20 11:49:16 +08:00
|
|
|
- hostvars[item]['_nfs_handler_called'] | default(False)
|
2017-09-27 06:55:31 +08:00
|
|
|
- nfs_socket_stat.rc == 0
|
2017-10-17 21:54:17 +08:00
|
|
|
with_items: "{{ groups[nfs_group_name] }}"
|
2017-10-07 07:23:30 +08:00
|
|
|
delegate_to: "{{ item }}"
|
2017-12-20 11:49:16 +08:00
|
|
|
run_once: True
|
2017-09-27 08:08:40 +08:00
|
|
|
|
2017-09-28 00:22:15 +08:00
|
|
|
- name: restart ceph nfs daemon(s) - container
|
2017-11-06 22:02:47 +08:00
|
|
|
command: /usr/bin/env bash /tmp/restart_nfs_daemon.sh
|
2017-09-28 00:22:15 +08:00
|
|
|
listen: "restart ceph nfss"
|
|
|
|
when:
|
|
|
|
# We do not want to run these checks on initial deployment (`socket.rc == 0`)
|
|
|
|
- nfs_group_name in group_names
|
|
|
|
- containerized_deployment
|
2017-11-27 21:59:30 +08:00
|
|
|
- ceph_nfs_container_stat.get('rc') == 0
|
2017-12-20 11:49:16 +08:00
|
|
|
- hostvars[item]['_nfs_handler_called'] | default(False)
|
2017-10-06 22:49:46 +08:00
|
|
|
- ceph_nfs_container_stat.get('stdout_lines', [])|length != 0
|
2017-10-17 21:54:17 +08:00
|
|
|
with_items: "{{ groups[nfs_group_name] }}"
|
2017-10-07 07:23:30 +08:00
|
|
|
delegate_to: "{{ item }}"
|
2017-12-20 11:49:16 +08:00
|
|
|
run_once: True
|
|
|
|
|
|
|
|
- name: set _nfs_handler_called after restart
|
|
|
|
set_fact:
|
|
|
|
_nfs_handler_called: False
|
|
|
|
listen: "restart ceph nfss"
|
|
|
|
|
|
|
|
- name: set _rbdmirror_handler_called before restart
|
|
|
|
set_fact:
|
|
|
|
_rbdmirror_handler_called: True
|
|
|
|
listen: "restart ceph rbdmirrors"
|
2017-09-28 00:22:15 +08:00
|
|
|
|
2017-09-27 08:08:40 +08:00
|
|
|
- name: copy rbd mirror restart script
|
|
|
|
template:
|
|
|
|
src: restart_rbd_mirror_daemon.sh.j2
|
|
|
|
dest: /tmp/restart_rbd_mirror_daemon.sh
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0750
|
|
|
|
listen: "restart ceph rbdmirrors"
|
|
|
|
when:
|
|
|
|
- rbdmirror_group_name in group_names
|
|
|
|
|
2017-09-28 00:22:15 +08:00
|
|
|
- name: restart ceph rbd mirror daemon(s) - non container
|
2017-11-06 22:02:47 +08:00
|
|
|
command: /usr/bin/env bash /tmp/restart_rbd_mirror_daemon.sh
|
2017-09-27 08:08:40 +08:00
|
|
|
listen: "restart ceph rbdmirrors"
|
|
|
|
when:
|
|
|
|
# We do not want to run these checks on initial deployment (`socket.rc == 0`)
|
|
|
|
- rbdmirror_group_name in group_names
|
2017-09-28 00:22:15 +08:00
|
|
|
- not containerized_deployment
|
2017-12-20 11:49:16 +08:00
|
|
|
- hostvars[item]['_rbdmirror_handler_called'] | default(False)
|
2017-09-27 08:08:40 +08:00
|
|
|
- rbd_mirror_socket_stat.rc == 0
|
2017-10-17 21:54:17 +08:00
|
|
|
with_items: "{{ groups[rbdmirror_group_name] }}"
|
2017-10-07 07:23:30 +08:00
|
|
|
delegate_to: "{{ item }}"
|
2017-12-20 11:49:16 +08:00
|
|
|
run_once: True
|
2017-09-27 08:08:40 +08:00
|
|
|
|
2017-09-28 00:22:15 +08:00
|
|
|
- name: restart ceph rbd mirror daemon(s) - container
|
2017-11-06 22:02:47 +08:00
|
|
|
command: /usr/bin/env bash /tmp/restart_rbd_mirror_daemon.sh
|
2017-09-28 00:22:15 +08:00
|
|
|
listen: "restart ceph rbdmirrors"
|
|
|
|
when:
|
|
|
|
# We do not want to run these checks on initial deployment (`socket.rc == 0`)
|
|
|
|
- rbdmirror_group_name in group_names
|
|
|
|
- containerized_deployment
|
2017-11-27 21:59:30 +08:00
|
|
|
- ceph_rbd_mirror_container_stat.get('rc') == 0
|
2017-12-20 11:49:16 +08:00
|
|
|
- hostvars[item]['_rbdmirror_handler_called'] | default(False)
|
2017-10-06 22:49:46 +08:00
|
|
|
- ceph_rbd_mirror_container_stat.get('stdout_lines', [])|length != 0
|
2017-10-17 21:54:17 +08:00
|
|
|
with_items: "{{ groups[rbdmirror_group_name] }}"
|
2017-10-07 07:23:30 +08:00
|
|
|
delegate_to: "{{ item }}"
|
2017-12-20 11:49:16 +08:00
|
|
|
run_once: True
|
|
|
|
|
|
|
|
- name: set _rbdmirror_handler_called after restart
|
|
|
|
set_fact:
|
|
|
|
_rbdmirror_handler_called: False
|
|
|
|
listen: "restart ceph rbdmirrors"
|
|
|
|
|
|
|
|
- name: set _mgr_handler_called before restart
|
|
|
|
set_fact:
|
|
|
|
_mgr_handler_called: True
|
|
|
|
listen: "restart ceph mgrs"
|
2017-09-28 00:22:15 +08:00
|
|
|
|
2017-09-27 08:08:40 +08:00
|
|
|
- name: copy mgr restart script
|
|
|
|
template:
|
|
|
|
src: restart_mgr_daemon.sh.j2
|
|
|
|
dest: /tmp/restart_mgr_daemon.sh
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0750
|
|
|
|
listen: "restart ceph mgrs"
|
|
|
|
when:
|
|
|
|
- mgr_group_name in group_names
|
|
|
|
|
2017-09-28 00:22:15 +08:00
|
|
|
- name: restart ceph mgr daemon(s) - non container
|
2017-11-06 22:02:47 +08:00
|
|
|
command: /usr/bin/env bash /tmp/restart_mgr_daemon.sh
|
2017-09-27 08:08:40 +08:00
|
|
|
listen: "restart ceph mgrs"
|
|
|
|
when:
|
|
|
|
# We do not want to run these checks on initial deployment (`socket.rc == 0`)
|
|
|
|
- mgr_group_name in group_names
|
2017-09-28 00:22:15 +08:00
|
|
|
- not containerized_deployment
|
2017-12-20 11:49:16 +08:00
|
|
|
- hostvars[item]['_mgr_handler_called'] | default(False)
|
2017-09-27 08:08:40 +08:00
|
|
|
- mgr_socket_stat.rc == 0
|
2017-10-17 21:54:17 +08:00
|
|
|
with_items: "{{ groups[mgr_group_name] }}"
|
2017-10-07 07:23:30 +08:00
|
|
|
delegate_to: "{{ item }}"
|
2017-12-20 11:49:16 +08:00
|
|
|
run_once: True
|
2017-09-28 00:22:15 +08:00
|
|
|
|
|
|
|
- name: restart ceph mgr daemon(s) - container
|
2017-11-06 22:02:47 +08:00
|
|
|
command: /usr/bin/env bash /tmp/restart_mgr_daemon.sh
|
2017-09-28 00:22:15 +08:00
|
|
|
listen: "restart ceph mgrs"
|
|
|
|
when:
|
|
|
|
# We do not want to run these checks on initial deployment (`socket.rc == 0`)
|
|
|
|
- mgr_group_name in group_names
|
|
|
|
- containerized_deployment
|
2017-11-27 21:59:30 +08:00
|
|
|
- ceph_mgr_container_stat.get('rc') == 0
|
2017-12-20 11:49:16 +08:00
|
|
|
- hostvars[item]['_mgr_handler_called'] | default(False)
|
2017-10-06 22:49:46 +08:00
|
|
|
- ceph_mgr_container_stat.get('stdout_lines', [])|length != 0
|
2017-10-17 21:54:17 +08:00
|
|
|
with_items: "{{ groups[mgr_group_name] }}"
|
2017-10-07 07:23:30 +08:00
|
|
|
delegate_to: "{{ item }}"
|
2017-12-20 11:49:16 +08:00
|
|
|
run_once: True
|
|
|
|
|
|
|
|
- name: set _mgr_handler_called after restart
|
|
|
|
set_fact:
|
|
|
|
_mgr_handler_called: False
|
|
|
|
listen: "restart ceph mgrs"
|
2018-03-23 11:24:56 +08:00
|
|
|
|
|
|
|
- name: set _tcmu_runner_handler_called before restart
|
|
|
|
set_fact:
|
|
|
|
_tcmu_runner_handler_called: True
|
|
|
|
listen: "restart ceph tcmu-runner"
|
|
|
|
|
|
|
|
- name: copy tcmu-runner restart script
|
|
|
|
template:
|
|
|
|
src: restart_tcmu_runner.sh.j2
|
|
|
|
dest: /tmp/restart_tcmu_runner.sh
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0750
|
|
|
|
listen: "restart ceph tcmu-runner"
|
|
|
|
when:
|
|
|
|
- iscsi_gw_group_name in group_names
|
|
|
|
|
|
|
|
- name: restart tcmu-runner
|
|
|
|
command: /usr/bin/env bash /tmp/restart_tcmu_runner.sh
|
|
|
|
listen: "restart ceph tcmu-runner"
|
|
|
|
when:
|
|
|
|
- iscsi_gw_group_name in group_names
|
|
|
|
- ceph_tcmu_runner_stat.get('rc') == 0
|
|
|
|
- hostvars[item]['_tcmu_runner_handler_called'] | default(False)
|
|
|
|
- ceph_tcmu_runner_stat.get('stdout_lines', [])|length != 0
|
|
|
|
with_items: "{{ groups[iscsi_gw_group_name] }}"
|
|
|
|
delegate_to: "{{ item }}"
|
|
|
|
run_once: True
|
|
|
|
|
|
|
|
- name: set _tcmu_runner_handler_called after restart
|
|
|
|
set_fact:
|
|
|
|
_tcmu_runner_handler_called: False
|
|
|
|
listen: "restart ceph tcmu-runner"
|
|
|
|
|
|
|
|
- name: set _rbd_target_gw_handler_called before restart
|
|
|
|
set_fact:
|
|
|
|
_rbd_target_gw_handler_called: True
|
|
|
|
listen: "restart ceph rbd-target-gw"
|
|
|
|
|
|
|
|
- name: copy rbd-target-gw restart script
|
|
|
|
template:
|
|
|
|
src: restart_rbd_target_gw.sh.j2
|
|
|
|
dest: /tmp/restart_rbd_target_gw.sh
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0750
|
|
|
|
listen: "restart ceph rbd-target-gw"
|
|
|
|
when:
|
|
|
|
- iscsi_gw_group_name in group_names
|
|
|
|
|
|
|
|
- name: restart rbd-target-gw
|
|
|
|
command: /usr/bin/env bash /tmp/restart_rbd_target_gw.sh
|
|
|
|
listen: "restart ceph rbd-target-gw"
|
|
|
|
when:
|
|
|
|
- iscsi_gw_group_name in group_names
|
|
|
|
- ceph_rbd_target_gw_stat.get('rc') == 0
|
|
|
|
- hostvars[item]['_rbd_target_gw_handler_called'] | default(False)
|
|
|
|
- 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
|
|
|
|
listen: "restart ceph rbd-target-gw"
|
|
|
|
|
|
|
|
- name: set _rbd_target_api_handler_called before restart
|
|
|
|
set_fact:
|
|
|
|
_rbd_target_api_handler_called: True
|
|
|
|
listen: "restart ceph rbd-target-api"
|
|
|
|
|
|
|
|
- name: copy rbd-target-api restart script
|
|
|
|
template:
|
|
|
|
src: restart_rbd_target_api.sh.j2
|
|
|
|
dest: /tmp/restart_rbd_target_api.sh
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0750
|
|
|
|
listen: "restart ceph rbd-target-api"
|
|
|
|
when:
|
|
|
|
- iscsi_gw_group_name in group_names
|
|
|
|
|
|
|
|
- name: restart rbd-target-api
|
|
|
|
command: /usr/bin/env bash /tmp/restart_rbd_target_api.sh
|
|
|
|
listen: "restart ceph rbd-target-api"
|
|
|
|
when:
|
|
|
|
- iscsi_gw_group_name in group_names
|
|
|
|
- ceph_rbd_target_api_stat.get('rc') == 0
|
|
|
|
- hostvars[item]['_rbd_target_api_handler_called'] | default(False)
|
|
|
|
- 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
|
|
|
|
listen: "restart ceph rbd-target-api"
|