Skip to content

Commit

Permalink
ceph-crash: move handler in the dedicated role
Browse files Browse the repository at this point in the history
Move the ceph crash handler into its own role.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1956441

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
  • Loading branch information
dsavineau committed Jul 5, 2021
1 parent 993d06c commit 1a9e667
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 64 deletions.
2 changes: 0 additions & 2 deletions infrastructure-playbooks/rolling_update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -912,8 +912,6 @@
- import_role:
name: ceph-facts
tasks_from: container_binary.yml
- import_role:
name: ceph-handler
- import_role:
name: ceph-crash

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -673,9 +673,6 @@
name: ceph-facts
tasks_from: container_binary.yml

- import_role:
name: ceph-handler

- import_role:
name: ceph-crash

Expand Down
9 changes: 9 additions & 0 deletions roles/ceph-container-common/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
- name: restart ceph crash
systemd:
name: ceph-crash@{{ ansible_facts['hostname'] }}
state: restarted
enabled: yes
masked: no
daemon_reload: yes
ignore_errors: true
9 changes: 9 additions & 0 deletions roles/ceph-crash/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
- name: restart ceph crash
systemd:
name: ceph-crash@{{ ansible_facts['hostname'] }}
state: restarted
enabled: yes
masked: no
daemon_reload: yes
ignore_errors: true
11 changes: 0 additions & 11 deletions roles/ceph-handler/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,6 @@
when: iscsi_gw_group_name in group_names
listen: "restart ceph rbd-target-api-gw"

- name: ceph crash handler
include_tasks: handler_crash.yml
listen: "restart ceph crash"
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, [])

- name: remove tempdir for scripts
file:
path: "{{ tmpdirpath.path }}"
Expand Down
16 changes: 1 addition & 15 deletions roles/ceph-handler/tasks/check_socket_non_container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -227,18 +227,4 @@
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, [])
when: inventory_hostname in groups.get(iscsi_gw_group_name, [])
18 changes: 0 additions & 18 deletions roles/ceph-handler/tasks/handler_crash.yml

This file was deleted.

11 changes: 0 additions & 11 deletions roles/ceph-handler/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,6 @@
handler_mgr_status: "{{ 0 in (mgr_socket.results | map(attribute='rc') | list) if not containerized_deployment | bool else (ceph_mgr_container_stat.get('rc') == 0 and ceph_mgr_container_stat.get('stdout_lines', []) | length != 0) }}"
when: inventory_hostname in groups.get(mgr_group_name, [])

- name: set_fact handler_crash_status
set_fact:
handler_crash_status: "{{ crash_process.get('rc') == 0 if not containerized_deployment | bool else (ceph_crash_container_stat.get('rc') == 0 and ceph_crash_container_stat.get('stdout_lines', []) | length != 0) }}"
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, [])

- name: rgw multi-instances related tasks
when:
- not docker2podman | default(false) | bool
Expand Down
2 changes: 0 additions & 2 deletions site-container.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,6 @@
- import_role:
name: ceph-facts
tasks_from: container_binary.yml
- import_role:
name: ceph-handler
- import_role:
name: ceph-crash

Expand Down
2 changes: 0 additions & 2 deletions site.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -488,8 +488,6 @@
- import_role:
name: ceph-facts
tasks_from: container_binary.yml
- import_role:
name: ceph-handler
- import_role:
name: ceph-crash

Expand Down

0 comments on commit 1a9e667

Please sign in to comment.