Hello,
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:
pre_tasks:
- name: variables Instance 1 DV/QA
set_fact:
KARAFHTTPPORT: "210{{ Slice }}"
KARAFSSHPORT: "211{{ Slice }}"
KARAFRMIREGISTRYPORT: "212{{ Slice }}"
KARAFRMISERVERPORT: "213{{ Slice }}"
when: numint == '1' and ( EnvType == 'DV' or EnvType == 'QA')
...
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 ?
Regards,
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/ce1bde29-ecf2-48de-abae-52d574309091%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.