Using include_tasks with the same file several times inside a role

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

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

It was a typo, even like that only the first one is executed.

Regards

A sábado, 23/02/2019, 15:22, BHARATHI DURAI RAJ <cad.bharathi@gmail.com> escreveu:

You have only shown us part of your code, since it's not working you have error(s) in that code.