You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
866 B
29 lines
866 B
---
|
|
# https://raspberrypi.stackexchange.com/a/99625
|
|
- name: Configure watchdog runtime to 10 sec
|
|
ansible.builtin.replace:
|
|
# Looking for line: #RuntimeWatchdogSec=0
|
|
regexp: '#?RuntimeWatchdogSec=\d+'
|
|
replace: 'RuntimeWatchdogSec=10'
|
|
path: /etc/systemd/system.conf
|
|
become: true
|
|
become_method: sudo
|
|
register: runtime_watchdoggo
|
|
- name: Configure watchdog shutdown timer to 10 min
|
|
ansible.builtin.replace:
|
|
# Looking for line #ShutdownWatchdogSec=10min
|
|
regexp: '#?ShutdownWatchdogSec=\d+[a-z]*'
|
|
replace: 'ShutdownWatchdogSec=10min'
|
|
path: /etc/systemd/system.conf
|
|
become: true
|
|
become_method: sudo
|
|
register: shutdown_watchdoggo
|
|
|
|
- name: Reload systemd if needed
|
|
ansible.builtin.systemd_service:
|
|
daemon_reload: true
|
|
become: true
|
|
become_method: sudo
|
|
when: runtime_watchdoggo.changed or shutdown_watchdoggo.changed
|
|
|