29 lines
730 B
YAML
29 lines
730 B
YAML
---
|
|
- name: Enable hardware watchdog
|
|
hosts: all
|
|
gather_facts: no
|
|
roles:
|
|
- common
|
|
become: yes
|
|
|
|
tasks:
|
|
- name: Enable systemd watchdog in system.conf
|
|
ansible.builtin.lineinfile:
|
|
path: /etc/systemd/system.conf
|
|
regexp: '^#?{{ item.key }}='
|
|
line: "{{ item.key }}={{ item.value }}"
|
|
loop:
|
|
- { key: 'RuntimeWatchdogSec', value: '15' }
|
|
- { key: 'RebootWatchdogSec', value: '10min' }
|
|
notify: Restart systemd
|
|
|
|
- name: Ensure watchdog device permissions (Optional/Standard)
|
|
ansible.builtin.shell: |
|
|
modprobe bcm2835_wdt
|
|
changed_when: false
|
|
|
|
handlers:
|
|
- name: Restart systemd
|
|
ansible.builtin.systemd:
|
|
daemon_reexec: yes
|