Add automatic reboots to main playbook
This commit is contained in:
parent
90da5ad3b1
commit
a7aa38a8e9
13
playbooks/tags_autoreboot.yml
Executable file
13
playbooks/tags_autoreboot.yml
Executable file
@ -0,0 +1,13 @@
|
|||||||
|
#!/usr/bin/env ansible-playbook
|
||||||
|
# vim:ft=ansible:
|
||||||
|
---
|
||||||
|
- hosts: tags_autoreboot
|
||||||
|
serial: 1
|
||||||
|
tasks:
|
||||||
|
- name: check for reboot-required
|
||||||
|
stat: path=/var/run/reboot-required
|
||||||
|
register: s
|
||||||
|
- name: reboot
|
||||||
|
reboot: reboot_timeout=300
|
||||||
|
when: s.stat.exists
|
||||||
|
become: yes
|
1
site.yml
1
site.yml
@ -25,3 +25,4 @@
|
|||||||
- import_playbook: playbooks/tags_ansible-pull.yml
|
- import_playbook: playbooks/tags_ansible-pull.yml
|
||||||
# Housekeeping tags for one-off tasks
|
# Housekeeping tags for one-off tasks
|
||||||
- import_playbook: playbooks/tags_docker-prune.yml
|
- import_playbook: playbooks/tags_docker-prune.yml
|
||||||
|
- import_playbook: playbooks/tags_autoreboot.yml
|
||||||
|
Loading…
Reference in New Issue
Block a user