What should be the proper way to use include_tasks in ansible 2.5

Hi all,

Following the discussion in issue #35065: included include_role fails to escalate since ebf971f
(see also https://groups.google.com/forum/#!searchin/ansible-project/chipcha|sort:date/ansible-project/2-A3BVF02X4/USl6hixDDQAJ)

My issue is related to include_tasks.
I understood that for ansible 2.4.3 the behavior of include_tasks will stay the same while in ansible 2.5 this behavior is about to be changed and only import_tasks should merge down attributes.
To apply my playlist for ansible 2.5 should I change all include_tasks to import_tasks? If so, should I need to add anything else?
Any help will be appreciated

Thanks

I’ve recently started work on this specific topic for the 2.5 porting guide which you can find at https://github.com/ansible/ansible/pull/35199

Thanks for the quick input Matt :slight_smile:

Would it be possible to also add best practices of how to migrate include_tasks to import_tasks with loops
After https://github.com/ansible/ansible/pull/33595 it seems that all my include_tasks with tags are ignored and changing those to import_tasks after they already configured loops seems to be impossible.

Thanks

chipcha wrote:

Would it be possible to also add best practices of how to migrate
include_tasks to import_tasks with loops
After https://github.com/ansible/ansible/pull/33595 it seems that all my
include_tasks with tags are ignored

I can confirm this issue using ansible-2.4.3.0-0.5.rc2.tar.gz and I
wonder why such a breaking change is done for minor update within 2.4.x.

Ciao, Michael.

Michael,

It is indeed a changed behavior in 2.4.3rc2, however we are working to revert that specific behavior, which will be included in an upcoming rc3.