Split watchdog related setup in a separate file
This commit is contained in:
parent
2948ae6ebf
commit
465f1d0cb0
2 changed files with 46 additions and 44 deletions
|
@ -408,47 +408,5 @@
|
|||
#
|
||||
# Watchdog stuff
|
||||
#
|
||||
- name: See if theres a watchdog device
|
||||
stat: path=/dev/watchdog
|
||||
when: ansible_virtualization_role == 'guest'
|
||||
register: watchdog_dev
|
||||
|
||||
- name: install watchdog
|
||||
yum: pkg={{ item }} state=present
|
||||
with_items:
|
||||
- watchdog
|
||||
tags:
|
||||
- packages
|
||||
- watchdog
|
||||
- base
|
||||
when: ansible_distribution_major_version|int < 22 and ansible_virtualization_role == 'guest' and watchdog_dev.stat.exists
|
||||
|
||||
- name: install watchdog
|
||||
dnf: pkg={{ item }} state=present
|
||||
with_items:
|
||||
- watchdog
|
||||
tags:
|
||||
- packages
|
||||
- watchdog
|
||||
- base
|
||||
when: ansible_distribution_major_version|int > 21 and ansible_virtualization_role == 'guest' and watchdog_dev.stat.exists
|
||||
|
||||
- name: watchdog device configuration
|
||||
copy: src=watchdog.conf dest=/etc/watchdog.conf owner=root group=root mode=644
|
||||
when: ansible_virtualization_role == 'guest' and watchdog_dev.stat.exists
|
||||
tags:
|
||||
- config
|
||||
- watchdog
|
||||
- base
|
||||
notify: restart watchdog
|
||||
|
||||
- name: Set watchdog to run on boot
|
||||
service: name=watchdog enabled=yes
|
||||
when: ansible_virtualization_role == 'guest' and watchdog_dev.stat.exists
|
||||
ignore_errors: true
|
||||
notify:
|
||||
- restart watchdog
|
||||
tags:
|
||||
- service
|
||||
- watchdog
|
||||
- base
|
||||
- name: Set up watchdog
|
||||
include: watchdog.yml
|
||||
|
|
44
roles/base/tasks/watchdog.yml
Normal file
44
roles/base/tasks/watchdog.yml
Normal file
|
@ -0,0 +1,44 @@
|
|||
- name: See if theres a watchdog device
|
||||
stat: path=/dev/watchdog
|
||||
when: ansible_virtualization_role == 'guest'
|
||||
register: watchdog_dev
|
||||
|
||||
- name: install watchdog
|
||||
yum: pkg={{ item }} state=present
|
||||
with_items:
|
||||
- watchdog
|
||||
tags:
|
||||
- packages
|
||||
- watchdog
|
||||
- base
|
||||
when: ansible_distribution_major_version|int < 22 and ansible_virtualization_role == 'guest' and watchdog_dev.stat.exists
|
||||
|
||||
- name: install watchdog
|
||||
dnf: pkg={{ item }} state=present
|
||||
with_items:
|
||||
- watchdog
|
||||
tags:
|
||||
- packages
|
||||
- watchdog
|
||||
- base
|
||||
when: ansible_distribution_major_version|int > 21 and ansible_virtualization_role == 'guest' and watchdog_dev.stat.exists
|
||||
|
||||
- name: watchdog device configuration
|
||||
copy: src=watchdog.conf dest=/etc/watchdog.conf owner=root group=root mode=644
|
||||
when: ansible_virtualization_role == 'guest' and watchdog_dev.stat.exists
|
||||
tags:
|
||||
- config
|
||||
- watchdog
|
||||
- base
|
||||
notify: restart watchdog
|
||||
|
||||
- name: Set watchdog to run on boot
|
||||
service: name=watchdog enabled=yes
|
||||
when: ansible_virtualization_role == 'guest' and watchdog_dev.stat.exists
|
||||
ignore_errors: true
|
||||
notify:
|
||||
- restart watchdog
|
||||
tags:
|
||||
- service
|
||||
- watchdog
|
||||
- base
|
Loading…
Add table
Add a link
Reference in a new issue