From 5b12eb5af25ef67660d5c7574ebfe63da9324a73 Mon Sep 17 00:00:00 2001 From: Salt Date: Thu, 25 Nov 2021 16:16:53 -0600 Subject: [PATCH] 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. --- playbooks/cleanup.yml | 12 ++++++++++++ site.yml | 2 ++ 2 files changed, 14 insertions(+) create mode 100755 playbooks/cleanup.yml diff --git a/playbooks/cleanup.yml b/playbooks/cleanup.yml new file mode 100755 index 0000000..086c01c --- /dev/null +++ b/playbooks/cleanup.yml @@ -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 diff --git a/site.yml b/site.yml index 8e343cb..ebcc944 100755 --- a/site.yml +++ b/site.yml @@ -34,3 +34,5 @@ # Housekeeping tags for one-off tasks - import_playbook: playbooks/tags_docker-prune.yml - import_playbook: playbooks/tags_autoreboot.yml + # Last little bit of cleanup +- import_playbook: playbooks/cleanup.yml