Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: crmsh watchdog correction, remove obsolete assert for softdog #217

Merged
merged 1 commit into from
Jul 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 5 additions & 22 deletions tasks/shell_crmsh/sbd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,6 @@
- name: Manage SBD
when: ha_cluster_sbd_enabled
block:
- name: Check if watchdog is configured when use_softdog is false
ansible.builtin.stat:
path: '/dev/watchdog'
register: __ha_cluster_watchdog_check

- name: Assert that watchdog is configured when use_softdog is false
ansible.builtin.assert:
that: __ha_cluster_watchdog_check.stat.exists
fail_msg: >-
The role has been called with the 'ha_cluster.sbd_softdog' option set
to false. This expects the device '/dev/watchdog' to be available but
'/dev/watchdog' was not found. You must configure the watchdog before
running the role. If no watchdog is available, set
'ha_cluster.sbd_softdog' to 'true' and the softdog will be
automatically configured.
success_msg: >-
The watchdog device was found.
when:
- "'softdog' not in ha_cluster.sbd_watchdog_modules"

- name: Configure SBD watchdog
block:
- name: Configure and unload watchdog kernel modules from blocklist
Expand All @@ -45,6 +25,8 @@
state: absent
loop: "{{ ha_cluster.sbd_watchdog_modules_blocklist | d([]) }}"

# Softdog is minimum that needs to be provided if /dev/watchdog is not present.
# This ensures that SBD service does not fail due to missing /dev/watchdog.
- name: Configure and load watchdog kernel module
block:
- name: Configure watchdog kernel modules
Expand All @@ -55,13 +37,14 @@
regexp: "^{{ item }}"
line: "{{ item }}"
state: present
loop: "{{ ha_cluster.sbd_watchdog_modules | d([]) }}"
loop: "{{ ha_cluster.sbd_watchdog_modules | d(['softdog']) }}"

- name: Load watchdog kernel modules
community.general.modprobe:
name: "{{ item }}"
state: present
loop: "{{ ha_cluster.sbd_watchdog_modules | d([]) }}"
loop: "{{ ha_cluster.sbd_watchdog_modules | d(['softdog']) }}"


- name: Manage SBD devices
# Ideally, the block as a whole should run one node at a time. This does
Expand Down
Loading