Try this one
- name: task with var1
include_tasks: external.yaml
vars:
my_var: var1
- name: task with var2
include_tasks: external.yaml
vars:
my_var: var2
On Saturday, 23 February 2019 20:27:12 UTC+5:30, Paulo Silva wrote:
>
> Hi,
>
> Is it possible do to something like this inside a role?
>
> - name: task with var1
> include_tasks: external.yaml
> vars:
> my_var=var1
>
> - name task with var2
> include_tasks: external.yaml
> vars:
> my_var=var2
>
> I'm no getting any error but it appears that only the first include_tasks
> is used, switching to import_tasks as the same behavior.
>
> Is is expected? Any other to achieve this?
>
> Thanks
>
--
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/dd2b9c97-e819-4b7c-8388-5f4a01cf9d2c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.