Files
fedora-infra_ansible/roles/base/tasks/watchdog.yml
Kevin Fenzi e196958322 base: fix another handler case
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2025-01-16 14:52:49 -08:00

38 lines
1001 B
YAML

---
- name: See if theres a watchdog device
stat: path=/dev/watchdog
when: ansible_virtualization_role is defined and ansible_virtualization_role == 'guest'
check_mode: no
failed_when: no
register: watchdog_dev
- block:
- name: Install watchdog
ansible.builtin.package: name={{ item }} state=present
with_items:
- watchdog
tags:
- packages
- watchdog
- base
- name: Watchdog device configuration
ansible.builtin.copy: src=watchdog.conf dest=/etc/watchdog.conf owner=root group=root mode=0644
tags:
- config
- watchdog
- base
notify: Restart watchdog
- name: Set watchdog to run on boot
service: name=watchdog enabled=yes
ignore_errors: true
notify:
- Restart watchdog
tags:
- service
- watchdog
- base
when: watchdog_dev is defined and ansible_virtualization_role is defined and ansible_virtualization_role == 'guest' and watchdog_dev.stat.exists