Remove nagios shit from autoreboot
This commit is contained in:
parent
b53ce3efaa
commit
ef036fca76
@ -3,34 +3,11 @@
|
|||||||
---
|
---
|
||||||
- hosts: tags_autoreboot
|
- hosts: tags_autoreboot
|
||||||
gather_facts: no
|
gather_facts: no
|
||||||
module_defaults:
|
|
||||||
nagios:
|
|
||||||
author: Ansible
|
|
||||||
action: downtime
|
|
||||||
cmdfile: /data/nagios/var/rw/nagios.cmd
|
|
||||||
comment: "Ansible tags_autoreboot task"
|
|
||||||
host: "{{ inventory_hostname }}"
|
|
||||||
minutes: 10
|
|
||||||
serial: 1
|
serial: 1
|
||||||
tasks:
|
tasks:
|
||||||
- name: check for reboot-required
|
- name: check for reboot-required
|
||||||
ansible.builtin.stat: path=/var/run/reboot-required
|
ansible.builtin.stat: path=/var/run/reboot-required
|
||||||
register: s
|
register: s
|
||||||
- name: reboot
|
|
||||||
block:
|
|
||||||
- name: attempt to schedule downtime
|
|
||||||
block:
|
|
||||||
- name: register nagios host downtime
|
|
||||||
nagios:
|
|
||||||
service: host
|
|
||||||
delegate_to: vm-general-1.ashburn.mgmt.desu.ltd
|
|
||||||
- name: register nagios service downtime
|
|
||||||
nagios:
|
|
||||||
service: all
|
|
||||||
delegate_to: vm-general-1.ashburn.mgmt.desu.ltd
|
|
||||||
rescue:
|
|
||||||
- name: notify of failure to reboot
|
|
||||||
ansible.builtin.debug: msg="Miscellaneous failure when scheduling downtime"
|
|
||||||
- name: reboot
|
- name: reboot
|
||||||
ansible.builtin.reboot: reboot_timeout=600
|
ansible.builtin.reboot: reboot_timeout=600
|
||||||
when: s.stat.exists
|
when: s.stat.exists
|
||||||
|
Loading…
Reference in New Issue
Block a user