2017-09-28 00:22:15 +08:00
|
|
|
---
|
|
|
|
- name: check for a ceph mon socket
|
|
|
|
shell: stat --printf=%n {{ rbd_client_admin_socket_path }}/{{ cluster }}-mon*.asok
|
|
|
|
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_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
|
2019-06-07 02:08:18 +08:00
|
|
|
command: grep -q {{ mon_socket_stat.stdout }} /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
|
|
|
|
when:
|
|
|
|
- inventory_hostname in groups.get(mon_group_name, [])
|
|
|
|
- mon_socket_stat.rc == 0
|
|
|
|
|
|
|
|
- name: remove ceph mon socket if exists and not used by a process
|
|
|
|
file:
|
|
|
|
name: "{{ mon_socket_stat.stdout }}"
|
|
|
|
state: absent
|
|
|
|
when:
|
|
|
|
- inventory_hostname in groups.get(mon_group_name, [])
|
|
|
|
- mon_socket_stat.rc == 0
|
2017-12-14 18:31:28 +08:00
|
|
|
- mon_socket.rc == 1
|
2017-09-28 00:22:15 +08:00
|
|
|
|
|
|
|
- name: check for a ceph osd socket
|
|
|
|
shell: |
|
|
|
|
stat --printf=%n {{ rbd_client_admin_socket_path }}/{{ cluster }}-osd*.asok
|
|
|
|
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_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
|
2019-06-07 02:08:18 +08:00
|
|
|
command: grep -q {{ osd_socket_stat.stdout }} /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
|
|
|
|
when:
|
|
|
|
- inventory_hostname in groups.get(osd_group_name, [])
|
|
|
|
- osd_socket_stat.rc == 0
|
|
|
|
|
|
|
|
- name: remove ceph osd socket if exists and not used by a process
|
|
|
|
file:
|
|
|
|
name: "{{ osd_socket_stat.stdout }}"
|
|
|
|
state: absent
|
|
|
|
when:
|
|
|
|
- inventory_hostname in groups.get(osd_group_name, [])
|
|
|
|
- osd_socket_stat.rc == 0
|
2017-12-14 18:31:28 +08:00
|
|
|
- osd_socket.rc == 1
|
2017-09-28 00:22:15 +08:00
|
|
|
|
|
|
|
- name: check for a ceph mds socket
|
|
|
|
shell: |
|
|
|
|
stat --printf=%n {{ rbd_client_admin_socket_path }}/{{ cluster }}-mds*.asok
|
|
|
|
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_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
|
2019-06-07 02:08:18 +08:00
|
|
|
command: grep -q {{ mds_socket_stat.stdout }} /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
|
|
|
|
when:
|
|
|
|
- inventory_hostname in groups.get(mds_group_name, [])
|
|
|
|
- mds_socket_stat.rc == 0
|
|
|
|
|
|
|
|
- name: remove ceph mds socket if exists and not used by a process
|
|
|
|
file:
|
|
|
|
name: "{{ mds_socket_stat.stdout }}"
|
|
|
|
state: absent
|
|
|
|
when:
|
|
|
|
- inventory_hostname in groups.get(mds_group_name, [])
|
|
|
|
- mds_socket_stat.rc == 0
|
2017-12-14 18:31:28 +08:00
|
|
|
- mds_socket.rc == 1
|
2017-09-28 00:22:15 +08:00
|
|
|
|
|
|
|
- name: check for a ceph rgw socket
|
|
|
|
shell: |
|
|
|
|
stat --printf=%n {{ rbd_client_admin_socket_path }}/{{ cluster }}-client.rgw*.asok
|
|
|
|
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_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
|
2019-06-07 02:08:18 +08:00
|
|
|
command: grep -q {{ rgw_socket_stat.stdout }} /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
|
|
|
|
when:
|
|
|
|
- inventory_hostname in groups.get(rgw_group_name, [])
|
|
|
|
- rgw_socket_stat.rc == 0
|
|
|
|
|
|
|
|
- name: remove ceph rgw socket if exists and not used by a process
|
|
|
|
file:
|
|
|
|
name: "{{ rgw_socket_stat.stdout }}"
|
|
|
|
state: absent
|
|
|
|
when:
|
|
|
|
- inventory_hostname in groups.get(rgw_group_name, [])
|
|
|
|
- rgw_socket_stat.rc == 0
|
2017-12-14 18:31:28 +08:00
|
|
|
- rgw_socket.rc == 1
|
2017-09-28 00:22:15 +08:00
|
|
|
|
|
|
|
- name: check for a ceph mgr socket
|
|
|
|
shell: |
|
|
|
|
stat --printf=%n {{ rbd_client_admin_socket_path }}/{{ cluster }}-mgr*.asok
|
|
|
|
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_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
|
2019-06-07 02:08:18 +08:00
|
|
|
command: grep -q {{ mgr_socket_stat.stdout }} /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
|
|
|
|
when:
|
|
|
|
- inventory_hostname in groups.get(mgr_group_name, [])
|
|
|
|
- mgr_socket_stat.rc == 0
|
|
|
|
|
|
|
|
- name: remove ceph mgr socket if exists and not used by a process
|
|
|
|
file:
|
|
|
|
name: "{{ mgr_socket_stat.stdout }}"
|
|
|
|
state: absent
|
|
|
|
when:
|
|
|
|
- inventory_hostname in groups.get(mgr_group_name, [])
|
|
|
|
- mgr_socket_stat.rc == 0
|
2017-12-14 18:31:28 +08:00
|
|
|
- mgr_socket.rc == 1
|
2017-09-28 00:22:15 +08:00
|
|
|
|
|
|
|
- name: check for a ceph rbd mirror socket
|
|
|
|
shell: |
|
|
|
|
stat --printf=%n {{ rbd_client_admin_socket_path }}/{{ cluster }}-client.rbd-mirror*.asok
|
|
|
|
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_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
|
2019-06-07 02:08:18 +08:00
|
|
|
command: grep -q {{ rbd_mirror_socket_stat.stdout }} /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
|
|
|
|
when:
|
|
|
|
- inventory_hostname in groups.get(rbdmirror_group_name, [])
|
|
|
|
- rbd_mirror_socket_stat.rc == 0
|
|
|
|
|
|
|
|
- name: remove ceph rbd mirror socket if exists and not used by a process
|
|
|
|
file:
|
|
|
|
name: "{{ rbd_mirror_socket_stat.stdout }}"
|
|
|
|
state: absent
|
|
|
|
when:
|
|
|
|
- inventory_hostname in groups.get(rbdmirror_group_name, [])
|
|
|
|
- rbd_mirror_socket_stat.rc == 0
|
2017-12-14 18:31:28 +08:00
|
|
|
- rbd_mirror_socket.rc == 1
|
2017-09-28 00:22:15 +08:00
|
|
|
|
|
|
|
- name: check for a ceph nfs ganesha socket
|
|
|
|
command: stat --printf=%n /var/run/ganesha.pid
|
|
|
|
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: nfs_socket_stat
|
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
|
|
|
|
|
|
|
- name: check if the ceph nfs ganesha socket is in-use
|
2019-06-07 02:08:18 +08:00
|
|
|
command: grep -q {{ nfs_socket_stat.stdout }} /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: nfs_socket
|
|
|
|
when:
|
|
|
|
- inventory_hostname in groups.get(nfs_group_name, [])
|
|
|
|
- nfs_socket_stat.rc == 0
|
|
|
|
|
|
|
|
- name: remove ceph nfs ganesha socket if exists and not used by a process
|
|
|
|
file:
|
|
|
|
name: "{{ nfs_socket_stat.stdout }}"
|
|
|
|
state: absent
|
|
|
|
when:
|
|
|
|
- inventory_hostname in groups.get(nfs_group_name, [])
|
|
|
|
- nfs_socket_stat.rc == 0
|
2017-12-14 18:31:28 +08:00
|
|
|
- nfs_socket.rc == 1
|
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, [])
|