Skip to content

Instantly share code, notes, and snippets.

@tsuchm
Created July 9, 2020 13:55
Show Gist options
  • Save tsuchm/4d7ee0b01a082902a60cce4e3b8e3429 to your computer and use it in GitHub Desktop.
Save tsuchm/4d7ee0b01a082902a60cce4e3b8e3429 to your computer and use it in GitHub Desktop.
Sample Ansible playbook of finalize task which is invoked when a task occurs a modification
- name: first task
register: current_task
- set_fact:
taskset_changed: "{{ current_task.changed }}"
- name: second task
register: current_task
- set_fact:
taskset_changed: "{{ taskset_changed or current_task.changed }}"
- name: finalize task
when: taskset_changed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment