Is there a way to run a specific task or role at the very beginning of every ansible-playbook
run?
I'm looking for something that would go into ansible.cfg
or something like that, so all playbooks using that file would run a specific task at the beginning.
My intention is to use it for doing some verifications: for example, "is the local host listed on the inventory? If not, perhaps I'm using the wrong inventory".
I could import
or include
such a role in every playbook, but I want it to be automatic, and to work even for playbooks that don't know about that role.
pre_tasks
to the playbooks.