ceph-ansible/roles/ceph-handler/tasks/check_socket_non_container.yml

244 lines
7.0 KiB
YAML
Raw Normal View History

---
- name: find ceph mon socket
find:
paths: ["{{ rbd_client_admin_socket_path }}"]
recurse: yes
file_type: any
patterns: "{{ cluster }}-mon*.asok"
use_regex: no
register: mon_socket_stat
when: inventory_hostname in groups.get(mon_group_name, [])
- name: check if the ceph mon socket is in-use
command: grep -q {{ item.path }} /proc/net/unix
changed_when: false
failed_when: false
check_mode: no
register: mon_socket
with_items: "{{ mon_socket_stat.files }}"
when:
- inventory_hostname in groups.get(mon_group_name, [])
- mon_socket_stat.files | length > 0
- name: remove ceph mon socket if exists and not used by a process
file:
name: "{{ item.0.path }}"
state: absent
with_together:
- "{{ mon_socket_stat.files }}"
- "{{ mon_socket.results }}"
when:
- inventory_hostname in groups.get(mon_group_name, [])
- 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
register: osd_socket_stat
when: inventory_hostname in groups.get(osd_group_name, [])
- name: check if the ceph osd socket is in-use
command: grep -q {{ item.path }} /proc/net/unix
changed_when: false
failed_when: false
check_mode: no
register: osd_socket
with_items: "{{ osd_socket_stat.files }}"
when:
- inventory_hostname in groups.get(osd_group_name, [])
- osd_socket_stat.files | length > 0
- name: remove ceph osd socket if exists and not used by a process
file:
name: "{{ item.0.path }}"
state: absent
with_together:
- "{{ osd_socket_stat.files }}"
- "{{ osd_socket.results }}"
when:
- inventory_hostname in groups.get(osd_group_name, [])
- 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
register: mds_socket_stat
when: inventory_hostname in groups.get(mds_group_name, [])
- name: check if the ceph mds socket is in-use
command: grep -q {{ item.path }} /proc/net/unix
changed_when: false
failed_when: false
check_mode: no
register: mds_socket
with_items: "{{ mds_socket_stat.files }}"
when:
- inventory_hostname in groups.get(mds_group_name, [])
- mds_socket_stat.files | length > 0
- name: remove ceph mds socket if exists and not used by a process
file:
name: "{{ item.0.path }}"
state: absent
with_together:
- "{{ mds_socket_stat.files }}"
- "{{ mds_socket.results }}"
when:
- inventory_hostname in groups.get(mds_group_name, [])
- 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
register: rgw_socket_stat
when: inventory_hostname in groups.get(rgw_group_name, [])
- name: check if the ceph rgw socket is in-use
command: grep -q {{ item.path }} /proc/net/unix
changed_when: false
failed_when: false
check_mode: no
register: rgw_socket
with_items: "{{ rgw_socket_stat.files }}"
when:
- inventory_hostname in groups.get(rgw_group_name, [])
- rgw_socket_stat.files | length > 0
- name: remove ceph rgw socket if exists and not used by a process
file:
name: "{{ item.0.path }}"
state: absent
with_together:
- "{{ rgw_socket_stat.files }}"
- "{{ rgw_socket.results }}"
when:
- inventory_hostname in groups.get(rgw_group_name, [])
- 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
register: mgr_socket_stat
when: inventory_hostname in groups.get(mgr_group_name, [])
- name: check if the ceph mgr socket is in-use
command: grep -q {{ item.path }} /proc/net/unix
changed_when: false
failed_when: false
check_mode: no
register: mgr_socket
with_items: "{{ mgr_socket_stat.files }}"
when:
- inventory_hostname in groups.get(mgr_group_name, [])
- mgr_socket_stat.files | length > 0
- name: remove ceph mgr socket if exists and not used by a process
file:
name: "{{ item.0.path }}"
state: absent
with_together:
- "{{ mgr_socket_stat.files }}"
- "{{ mgr_socket.results }}"
when:
- inventory_hostname in groups.get(mgr_group_name, [])
- 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
register: rbd_mirror_socket_stat
when: inventory_hostname in groups.get(rbdmirror_group_name, [])
- name: check if the ceph rbd mirror socket is in-use
command: grep -q {{ item.path }} /proc/net/unix
changed_when: false
failed_when: false
check_mode: no
register: rbd_mirror_socket
with_items: "{{ rbd_mirror_socket_stat.files }}"
when:
- inventory_hostname in groups.get(rbdmirror_group_name, [])
- rbd_mirror_socket_stat.files | length > 0
- name: remove ceph rbd mirror socket if exists and not used by a process
file:
name: "{{ item.0.path }}"
state: absent
with_together:
- "{{ rbd_mirror_socket_stat.files }}"
- "{{ rbd_mirror_socket.results }}"
when:
- inventory_hostname in groups.get(rbdmirror_group_name, [])
- rbd_mirror_socket_stat.files | length > 0
- item.1.rc == 1
- name: check for a nfs ganesha pid
command: "pgrep ganesha.nfsd"
register: nfs_process
changed_when: false
failed_when: false
check_mode: no
when: inventory_hostname in groups.get(nfs_group_name, [])
- name: check for a tcmu-runner
command: "pgrep tcmu-runner"
register: ceph_tcmu_runner_stat
changed_when: false
failed_when: false
check_mode: no
when: inventory_hostname in groups.get(iscsi_gw_group_name, [])
- 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
when: inventory_hostname in groups.get(iscsi_gw_group_name, [])
- 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
when: inventory_hostname in groups.get(iscsi_gw_group_name, [])
- name: check for a ceph-crash process
command: pgrep ceph-crash
changed_when: false
failed_when: false
check_mode: no
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, [])