Ansible task always run

Hi…

I’m looking for a way to always run a task at the end of script, even if tasks before that were failed. Is there any option such as always_run etc.

Please advise.

Thanks.
GJ

I’m looking for a way to always run a task at the end of script, even if tasks before that were failed. Is there any option such as always_run etc.

Yes: https://docs.ansible.com/ansible/playbooks_checkmode.html#running-a-task-in-check-mode . Probably doesn’t do what you want.

You may want block: always: https://docs.ansible.com/ansible/playbooks_blocks.html

Cheers,
Paul

I am not an expert, but IMHO this would mean setting "ignore_errors:
true" on all tasks before the one that should always run...

Johannes

as aforementioned - blocks: always feature in 2.0 seems to suffice my requirement.

thanks.

thanks. that helped.