Refactor the condition to setup the watchdog with a block
This commit is contained in:
parent
2b470d2fa0
commit
2f26bd0f63
1 changed files with 26 additions and 26 deletions
|
@ -3,32 +3,32 @@
|
||||||
when: ansible_virtualization_role == 'guest'
|
when: ansible_virtualization_role == 'guest'
|
||||||
register: watchdog_dev
|
register: watchdog_dev
|
||||||
|
|
||||||
- name: install watchdog
|
- block:
|
||||||
package: pkg={{ item }} state=present
|
|
||||||
with_items:
|
|
||||||
- watchdog
|
|
||||||
tags:
|
|
||||||
- packages
|
|
||||||
- watchdog
|
|
||||||
- base
|
|
||||||
when: ansible_virtualization_role == 'guest' and watchdog_dev.stat.exists
|
|
||||||
|
|
||||||
- name: watchdog device configuration
|
- name: install watchdog
|
||||||
copy: src=watchdog.conf dest=/etc/watchdog.conf owner=root group=root mode=644
|
package: pkg={{ item }} state=present
|
||||||
when: ansible_virtualization_role == 'guest' and watchdog_dev.stat.exists
|
with_items:
|
||||||
tags:
|
- watchdog
|
||||||
- config
|
tags:
|
||||||
- watchdog
|
- packages
|
||||||
- base
|
- watchdog
|
||||||
notify: restart watchdog
|
- base
|
||||||
|
|
||||||
- name: Set watchdog to run on boot
|
- name: watchdog device configuration
|
||||||
service: name=watchdog enabled=yes
|
copy: src=watchdog.conf dest=/etc/watchdog.conf owner=root group=root mode=644
|
||||||
|
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: ansible_virtualization_role == 'guest' and watchdog_dev.stat.exists
|
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