I want to set variables with set_fact in a pre_tasks section.
This is working well, but it is 50 lines long and I want to have these lines to be set in all my playbooks.
Is there a way to include a pre_tasks ? Here is what I would expect:
I would like to copy these lines in a setting.yml file, I don’t know where it would be conventional, lets say in vars directory.
And then call it this way:
pre_tasks:
vars/setting.yml
Would this work and what is the conventional way to do this in Ansible ?
I want to set variables with set_fact in a pre_tasks section.
This is working well, but it is 50 lines long and I want to have these
lines to be set in all my playbooks.
Is there a way to include a pre_tasks ? Here is what I would expect: