mirror of
https://pagure.io/fedora-infra/ansible.git
synced 2026-04-30 21:41:53 +08:00
38 lines
1001 B
YAML
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
|