Rename cleanup.yml to site_post, since it now has all its jobs
This commit is contained in:
parent
0d4d3235c8
commit
f0646fb946
@ -1,42 +0,0 @@
|
|||||||
#!/usr/bin/env ansible-playbook
|
|
||||||
# vim:ft=ansible:
|
|
||||||
---
|
|
||||||
- hosts: all
|
|
||||||
gather_facts: no
|
|
||||||
tasks:
|
|
||||||
- name: touch ansible timestamp file
|
|
||||||
file: path=/var/lib/ansible-last-run state=touch mode='0644'
|
|
||||||
changed_when: no
|
|
||||||
- hosts: tags_autoreboot
|
|
||||||
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
|
|
||||||
tasks:
|
|
||||||
- name: check for reboot-required
|
|
||||||
stat: path=/var/run/reboot-required
|
|
||||||
register: s
|
|
||||||
- name: reboot
|
|
||||||
block:
|
|
||||||
- name: attempt to schedule downtime
|
|
||||||
block:
|
|
||||||
- name: register nagios host downtime
|
|
||||||
nagios:
|
|
||||||
service: host
|
|
||||||
delegate_to: web3.dallas.mgmt.desu.ltd
|
|
||||||
- name: register nagios service downtime
|
|
||||||
nagios:
|
|
||||||
service: all
|
|
||||||
delegate_to: web3.dallas.mgmt.desu.ltd
|
|
||||||
rescue:
|
|
||||||
- name: notify of failure to reboot
|
|
||||||
debug: msg="Miscellaneous failure when scheduling downtime"
|
|
||||||
- name: reboot
|
|
||||||
reboot: reboot_timeout=600
|
|
||||||
when: s.stat.exists
|
|
@ -1,8 +1,42 @@
|
|||||||
#!/usr/bin/env ansible-playbook
|
#!/usr/bin/env ansible-playbook
|
||||||
# vim:ft=ansible:
|
# vim:ft=ansible:
|
||||||
---
|
---
|
||||||
# Housekeeping tags for one-off tasks
|
- hosts: all
|
||||||
- import_playbook: tags_docker-prune.yml
|
gather_facts: no
|
||||||
- import_playbook: tags_autoreboot.yml
|
tasks:
|
||||||
# Last little bit of cleanup
|
- name: touch ansible timestamp file
|
||||||
- import_playbook: cleanup.yml
|
file: path=/var/lib/ansible-last-run state=touch mode='0644'
|
||||||
|
changed_when: no
|
||||||
|
- hosts: tags_autoreboot
|
||||||
|
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
|
||||||
|
tasks:
|
||||||
|
- name: check for reboot-required
|
||||||
|
stat: path=/var/run/reboot-required
|
||||||
|
register: s
|
||||||
|
- name: reboot
|
||||||
|
block:
|
||||||
|
- name: attempt to schedule downtime
|
||||||
|
block:
|
||||||
|
- name: register nagios host downtime
|
||||||
|
nagios:
|
||||||
|
service: host
|
||||||
|
delegate_to: web3.dallas.mgmt.desu.ltd
|
||||||
|
- name: register nagios service downtime
|
||||||
|
nagios:
|
||||||
|
service: all
|
||||||
|
delegate_to: web3.dallas.mgmt.desu.ltd
|
||||||
|
rescue:
|
||||||
|
- name: notify of failure to reboot
|
||||||
|
debug: msg="Miscellaneous failure when scheduling downtime"
|
||||||
|
- name: reboot
|
||||||
|
reboot: reboot_timeout=600
|
||||||
|
when: s.stat.exists
|
||||||
|
Loading…
Reference in New Issue
Block a user