I\'m currently writing an Ansible play that follows this general format and is run via a cron job:
pre_tasks: -Configuration / package installation tasks:
Don't use post_tasks block but rather have your cleanup process as part of regular tasks.
post_tasks
tasks