2017-09-28 00:22:15 +08:00
|
|
|
---
|
2020-10-06 20:58:46 +08:00
|
|
|
- name: find ceph mon socket
|
|
|
|
find:
|
|
|
|
paths: ["{{ rbd_client_admin_socket_path }}"]
|
|
|
|
recurse: yes
|
|
|
|
file_type: any
|
|
|
|
patterns: "{{ cluster }}-mon*.asok"
|
|
|
|
use_regex: no
|
2017-09-28 00:22:15 +08:00
|
|
|
register: mon_socket_stat
|
2019-04-01 23:46:15 +08:00
|
|
|
when: inventory_hostname in groups.get(mon_group_name, [])
|
2017-09-28 00:22:15 +08:00
|
|
|
|
|
|
|
- name: check if the ceph mon socket is in-use
|
2020-10-06 20:58:46 +08:00
|
|
|
command: grep -q {{ item.path }} /proc/net/unix
|
2017-09-28 00:22:15 +08:00
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
2017-10-25 22:53:34 +08:00
|
|
|
check_mode: no
|
2017-09-28 00:22:15 +08:00
|
|
|
register: mon_socket
|
2020-10-06 20:58:46 +08:00
|
|
|
with_items: "{{ mon_socket_stat.files }}"
|
2017-09-28 00:22:15 +08:00
|
|
|
when:
|
|
|
|
- inventory_hostname in groups.get(mon_group_name, [])
|
2020-10-06 20:58:46 +08:00
|
|
|
- mon_socket_stat.files | length > 0
|
2017-09-28 00:22:15 +08:00
|
|
|
|
|
|
|
- name: remove ceph mon socket if exists and not used by a process
|
|
|
|
file:
|
2020-10-06 20:58:46 +08:00
|
|
|
name: "{{ item.0.path }}"
|
2017-09-28 00:22:15 +08:00
|
|
|
state: absent
|
2020-10-06 20:58:46 +08:00
|
|
|
with_together:
|
|
|
|
- "{{ mon_socket_stat.files }}"
|
|
|
|
- "{{ mon_socket.results }}"
|
2017-09-28 00:22:15 +08:00
|
|
|
when:
|
|
|
|
- inventory_hostname in groups.get(mon_group_name, [])
|
2020-10-06 20:58:46 +08:00
|
|
|
- mon_socket_stat.files | length > 0
|
|
|
|
- item.1.rc == 1
|
|
|
|
|
|
|
|
- name: find ceph osd socket
|
|
|
|
find:
|
|
|
|
paths: ["{{ rbd_client_admin_socket_path }}"]
|
|
|
|
recurse: yes
|
|
|
|
file_type: any
|
|
|
|
patterns: "{{ cluster }}-osd.*.asok"
|
|
|
|
use_regex: no
|
2017-09-28 00:22:15 +08:00
|
|
|
register: osd_socket_stat
|
2019-04-01 23:46:15 +08:00
|
|
|
when: inventory_hostname in groups.get(osd_group_name, [])
|
2017-09-28 00:22:15 +08:00
|
|
|
|
|
|
|
- name: check if the ceph osd socket is in-use
|
2020-10-06 20:58:46 +08:00
|
|
|
command: grep -q {{ item.path }} /proc/net/unix
|
2017-09-28 00:22:15 +08:00
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
2017-10-25 22:53:34 +08:00
|
|
|
check_mode: no
|
2017-09-28 00:22:15 +08:00
|
|
|
register: osd_socket
|
2020-10-06 20:58:46 +08:00
|
|
|
with_items: "{{ osd_socket_stat.files }}"
|
2017-09-28 00:22:15 +08:00
|
|
|
when:
|
|
|
|
- inventory_hostname in groups.get(osd_group_name, [])
|
2020-10-06 20:58:46 +08:00
|
|
|
- osd_socket_stat.files | length > 0
|
2017-09-28 00:22:15 +08:00
|
|
|
|
|
|
|
- name: remove ceph osd socket if exists and not used by a process
|
|
|
|
file:
|
2020-10-06 20:58:46 +08:00
|
|
|
name: "{{ item.0.path }}"
|
2017-09-28 00:22:15 +08:00
|
|
|
state: absent
|
2020-10-06 20:58:46 +08:00
|
|
|
with_together:
|
|
|
|
- "{{ osd_socket_stat.files }}"
|
|
|
|
- "{{ osd_socket.results }}"
|
2017-09-28 00:22:15 +08:00
|
|
|
when:
|
|
|
|
- inventory_hostname in groups.get(osd_group_name, [])
|
2020-10-06 20:58:46 +08:00
|
|
|
- osd_socket_stat.files | length > 0
|
|
|
|
- item.1.rc == 1
|
|
|
|
|
|
|
|
- name: find ceph osd socket
|
|
|
|
find:
|
|
|
|
paths: ["{{ rbd_client_admin_socket_path }}"]
|
|
|
|
recurse: yes
|
|
|
|
file_type: any
|
|
|
|
patterns: "{{ cluster }}-mds*.asok"
|
|
|
|
use_regex: no
|
2017-09-28 00:22:15 +08:00
|
|
|
register: mds_socket_stat
|
2019-04-01 23:46:15 +08:00
|
|
|
when: inventory_hostname in groups.get(mds_group_name, [])
|
2017-09-28 00:22:15 +08:00
|
|
|
|
|
|
|
- name: check if the ceph mds socket is in-use
|
2020-10-06 20:58:46 +08:00
|
|
|
command: grep -q {{ item.path }} /proc/net/unix
|
2017-09-28 00:22:15 +08:00
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
2017-10-25 22:53:34 +08:00
|
|
|
check_mode: no
|
2017-09-28 00:22:15 +08:00
|
|
|
register: mds_socket
|
2020-10-06 20:58:46 +08:00
|
|
|
with_items: "{{ mds_socket_stat.files }}"
|
2017-09-28 00:22:15 +08:00
|
|
|
when:
|
|
|
|
- inventory_hostname in groups.get(mds_group_name, [])
|
2020-10-06 20:58:46 +08:00
|
|
|
- mds_socket_stat.files | length > 0
|
2017-09-28 00:22:15 +08:00
|
|
|
|
|
|
|
- name: remove ceph mds socket if exists and not used by a process
|
|
|
|
file:
|
2020-10-06 20:58:46 +08:00
|
|
|
name: "{{ item.0.path }}"
|
2017-09-28 00:22:15 +08:00
|
|
|
state: absent
|
2020-10-06 20:58:46 +08:00
|
|
|
with_together:
|
|
|
|
- "{{ mds_socket_stat.files }}"
|
|
|
|
- "{{ mds_socket.results }}"
|
2017-09-28 00:22:15 +08:00
|
|
|
when:
|
|
|
|
- inventory_hostname in groups.get(mds_group_name, [])
|
2020-10-06 20:58:46 +08:00
|
|
|
- mds_socket_stat.files | length > 0
|
|
|
|
- item.1.rc == 1
|
|
|
|
|
|
|
|
- name: find ceph rgw socket
|
|
|
|
find:
|
|
|
|
paths: ["{{ rbd_client_admin_socket_path }}"]
|
|
|
|
recurse: yes
|
|
|
|
file_type: any
|
|
|
|
patterns: "{{ cluster }}-client.rgw*.asok"
|
|
|
|
use_regex: no
|
2017-09-28 00:22:15 +08:00
|
|
|
register: rgw_socket_stat
|
2019-04-01 23:46:15 +08:00
|
|
|
when: inventory_hostname in groups.get(rgw_group_name, [])
|
2017-09-28 00:22:15 +08:00
|
|
|
|
|
|
|
- name: check if the ceph rgw socket is in-use
|
2020-10-06 20:58:46 +08:00
|
|
|
command: grep -q {{ item.path }} /proc/net/unix
|
2017-09-28 00:22:15 +08:00
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
2017-10-25 22:53:34 +08:00
|
|
|
check_mode: no
|
2017-09-28 00:22:15 +08:00
|
|
|
register: rgw_socket
|
2020-10-06 20:58:46 +08:00
|
|
|
with_items: "{{ rgw_socket_stat.files }}"
|
2017-09-28 00:22:15 +08:00
|
|
|
when:
|
|
|
|
- inventory_hostname in groups.get(rgw_group_name, [])
|
2020-10-06 20:58:46 +08:00
|
|
|
- rgw_socket_stat.files | length > 0
|
2017-09-28 00:22:15 +08:00
|
|
|
|
|
|
|
- name: remove ceph rgw socket if exists and not used by a process
|
|
|
|
file:
|
2020-10-06 20:58:46 +08:00
|
|
|
name: "{{ item.0.path }}"
|
2017-09-28 00:22:15 +08:00
|
|
|
state: absent
|
2020-10-06 20:58:46 +08:00
|
|
|
with_together:
|
|
|
|
- "{{ rgw_socket_stat.files }}"
|
|
|
|
- "{{ rgw_socket.results }}"
|
2017-09-28 00:22:15 +08:00
|
|
|
when:
|
|
|
|
- inventory_hostname in groups.get(rgw_group_name, [])
|
2020-10-06 20:58:46 +08:00
|
|
|
- rgw_socket_stat.files | length > 0
|
|
|
|
- item.1.rc == 1
|
|
|
|
|
|
|
|
- name: find ceph mgr socket
|
|
|
|
find:
|
|
|
|
paths: ["{{ rbd_client_admin_socket_path }}"]
|
|
|
|
recurse: yes
|
|
|
|
file_type: any
|
|
|
|
patterns: "{{ cluster }}-mgr*.asok"
|
|
|
|
use_regex: no
|
2017-09-28 00:22:15 +08:00
|
|
|
register: mgr_socket_stat
|
2019-04-01 23:46:15 +08:00
|
|
|
when: inventory_hostname in groups.get(mgr_group_name, [])
|
2017-09-28 00:22:15 +08:00
|
|
|
|
|
|
|
- name: check if the ceph mgr socket is in-use
|
2020-10-06 20:58:46 +08:00
|
|
|
command: grep -q {{ item.path }} /proc/net/unix
|
2017-09-28 00:22:15 +08:00
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
2017-10-25 22:53:34 +08:00
|
|
|
check_mode: no
|
2017-09-28 00:22:15 +08:00
|
|
|
register: mgr_socket
|
2020-10-06 20:58:46 +08:00
|
|
|
with_items: "{{ mgr_socket_stat.files }}"
|
2017-09-28 00:22:15 +08:00
|
|
|
when:
|
|
|
|
- inventory_hostname in groups.get(mgr_group_name, [])
|
2020-10-06 20:58:46 +08:00
|
|
|
- mgr_socket_stat.files | length > 0
|
2017-09-28 00:22:15 +08:00
|
|
|
|
|
|
|
- name: remove ceph mgr socket if exists and not used by a process
|
|
|
|
file:
|
2020-10-06 20:58:46 +08:00
|
|
|
name: "{{ item.0.path }}"
|
2017-09-28 00:22:15 +08:00
|
|
|
state: absent
|
2020-10-06 20:58:46 +08:00
|
|
|
with_together:
|
|
|
|
- "{{ mgr_socket_stat.files }}"
|
|
|
|
- "{{ mgr_socket.results }}"
|
2017-09-28 00:22:15 +08:00
|
|
|
when:
|
|
|
|
- inventory_hostname in groups.get(mgr_group_name, [])
|
2020-10-06 20:58:46 +08:00
|
|
|
- mgr_socket_stat.files | length > 0
|
|
|
|
- item.1.rc == 1
|
|
|
|
|
|
|
|
- name: find ceph rbd mirror socket
|
|
|
|
find:
|
|
|
|
paths: ["{{ rbd_client_admin_socket_path }}"]
|
|
|
|
recurse: yes
|
|
|
|
file_type: any
|
|
|
|
patterns: "{{ cluster }}-client.rbd-mirror*.asok"
|
|
|
|
use_regex: no
|
2017-09-28 00:22:15 +08:00
|
|
|
register: rbd_mirror_socket_stat
|
2019-04-01 23:46:15 +08:00
|
|
|
when: inventory_hostname in groups.get(rbdmirror_group_name, [])
|
2017-09-28 00:22:15 +08:00
|
|
|
|
|
|
|
- name: check if the ceph rbd mirror socket is in-use
|
2020-10-06 20:58:46 +08:00
|
|
|
command: grep -q {{ item.path }} /proc/net/unix
|
2017-09-28 00:22:15 +08:00
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
2017-10-25 22:53:34 +08:00
|
|
|
check_mode: no
|
2017-09-28 00:22:15 +08:00
|
|
|
register: rbd_mirror_socket
|
2020-10-06 20:58:46 +08:00
|
|
|
with_items: "{{ rbd_mirror_socket_stat.files }}"
|
2017-09-28 00:22:15 +08:00
|
|
|
when:
|
|
|
|
- inventory_hostname in groups.get(rbdmirror_group_name, [])
|
2020-10-06 20:58:46 +08:00
|
|
|
- rbd_mirror_socket_stat.files | length > 0
|
2017-09-28 00:22:15 +08:00
|
|
|
|
|
|
|
- name: remove ceph rbd mirror socket if exists and not used by a process
|
|
|
|
file:
|
2020-10-06 20:58:46 +08:00
|
|
|
name: "{{ item.0.path }}"
|
2017-09-28 00:22:15 +08:00
|
|
|
state: absent
|
2020-10-06 20:58:46 +08:00
|
|
|
with_together:
|
|
|
|
- "{{ rbd_mirror_socket_stat.files }}"
|
|
|
|
- "{{ rbd_mirror_socket.results }}"
|
2017-09-28 00:22:15 +08:00
|
|
|
when:
|
|
|
|
- inventory_hostname in groups.get(rbdmirror_group_name, [])
|
2020-10-06 20:58:46 +08:00
|
|
|
- rbd_mirror_socket_stat.files | length > 0
|
|
|
|
- item.1.rc == 1
|
2017-09-28 00:22:15 +08:00
|
|
|
|
2020-10-06 20:58:46 +08:00
|
|
|
- name: check for a nfs ganesha pid
|
|
|
|
command: "pgrep ganesha.nfsd"
|
|
|
|
register: nfs_process
|
2017-09-28 00:22:15 +08:00
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
2017-10-25 22:53:34 +08:00
|
|
|
check_mode: no
|
2019-04-01 23:46:15 +08:00
|
|
|
when: inventory_hostname in groups.get(nfs_group_name, [])
|
2017-09-28 00:22:15 +08:00
|
|
|
|
2018-03-23 11:24:56 +08:00
|
|
|
- name: check for a tcmu-runner
|
|
|
|
command: "pgrep tcmu-runner"
|
|
|
|
register: ceph_tcmu_runner_stat
|
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
|
|
|
check_mode: no
|
2019-04-01 23:46:15 +08:00
|
|
|
when: inventory_hostname in groups.get(iscsi_gw_group_name, [])
|
2018-03-23 11:24:56 +08:00
|
|
|
|
|
|
|
- name: check for a rbd-target-api
|
|
|
|
command: "pgrep rbd-target-api"
|
|
|
|
register: ceph_rbd_target_api_stat
|
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
|
|
|
check_mode: no
|
2019-04-01 23:46:15 +08:00
|
|
|
when: inventory_hostname in groups.get(iscsi_gw_group_name, [])
|
2018-03-23 11:24:56 +08:00
|
|
|
|
|
|
|
- name: check for a rbd-target-gw
|
|
|
|
command: "pgrep name=rbd-target-gw"
|
|
|
|
register: ceph_rbd_target_gw_stat
|
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
|
|
|
check_mode: no
|
2019-04-01 23:46:15 +08:00
|
|
|
when: inventory_hostname in groups.get(iscsi_gw_group_name, [])
|
2020-07-03 16:21:49 +08:00
|
|
|
|
|
|
|
- name: check for a ceph-crash process
|
|
|
|
command: pgrep ceph-crash
|
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
|
|
|
check_mode: no
|
2020-07-22 03:14:30 +08:00
|
|
|
register: crash_process
|
|
|
|
when:
|
|
|
|
- inventory_hostname in groups.get(mon_group_name, [])
|
|
|
|
or inventory_hostname in groups.get(mgr_group_name, [])
|
|
|
|
or inventory_hostname in groups.get(osd_group_name, [])
|
|
|
|
or inventory_hostname in groups.get(mds_group_name, [])
|
|
|
|
or inventory_hostname in groups.get(rgw_group_name, [])
|
|
|
|
or inventory_hostname in groups.get(rbdmirror_group_name, [])
|