Add a cleanup task to touch a file upon completion of site.yml

This playbook *should* assure that we have a file we can use for checking when the last full play was. It being in a playbook at the tail end of site.yml is paramount, since site.yml dying will cause alarms to be set off.
This commit is contained in:
Salt 2021-11-25 16:16:53 -06:00
parent e8a69aaaa1
commit 5b12eb5af2
2 changed files with 14 additions and 0 deletions

12
playbooks/cleanup.yml Executable file
View File

@ -0,0 +1,12 @@
#!/usr/bin/env ansible-playbook
# vim:ft=ansible:
---
# Preambulatory system configuration
- hosts: all
tasks:
- name: collect service facts
service_facts:
tags: [ always ]
- name: touch ansible timestamp file
file: path=/var/lib/ansible-last-run state=touch mode='0644'
changed_when: no

View File

@ -34,3 +34,5 @@
# 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 - import_playbook: playbooks/tags_autoreboot.yml
# Last little bit of cleanup
- import_playbook: playbooks/cleanup.yml