# What should be the proper way to use include\_tasks in ansible 2.5

**URL:** <https://forum.ansible.com/t/what-should-be-the-proper-way-to-use-include-tasks-in-ansible-2-5/26535>\
**Category:** Ansible Project\
**Created:** [January 22, 2018, 10:32pm UTC](https://forum.ansible.com/t/what-should-be-the-proper-way-to-use-include-tasks-in-ansible-2-5/26535 "2018-01-22T22:32:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![chipcha](https://avatars.discourse-cdn.com/v4/letter/c/2bfe46/32.png) [@chipcha](https://forum.ansible.com/u/chipcha)\
**Post date:** [January 22, 2018, 10:32pm UTC](https://forum.ansible.com/t/what-should-be-the-proper-way-to-use-include-tasks-in-ansible-2-5/26535/1 "2018-01-22T22:32:23Z")

</div>

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](https://groups.google.com/forum/#%21searchin/ansible-project/chipcha%7Csort: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

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [January 22, 2018, 10:36pm UTC](https://forum.ansible.com/t/what-should-be-the-proper-way-to-use-include-tasks-in-ansible-2-5/26535/2 "2018-01-22T22:36:18Z")

</div>

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](https://github.com/ansible/ansible/pull/35199)

---

<div class="post-metadata">

**Author:** ![chipcha](https://avatars.discourse-cdn.com/v4/letter/c/2bfe46/32.png) [@chipcha](https://forum.ansible.com/u/chipcha)\
**Post date:** [January 23, 2018, 10:13am UTC](https://forum.ansible.com/t/what-should-be-the-proper-way-to-use-include-tasks-in-ansible-2-5/26535/3 "2018-01-23T10:13:59Z")

</div>

Thanks for the quick input Matt 🙂

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](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

---

<div class="post-metadata">

**Author:** ![Michael\_Stroder](https://avatars.discourse-cdn.com/v4/letter/m/7ea924/32.png) [@Michael\_Stroder](https://forum.ansible.com/u/Michael_Stroder)\
**Post date:** [January 23, 2018, 10:40am UTC](https://forum.ansible.com/t/what-should-be-the-proper-way-to-use-include-tasks-in-ansible-2-5/26535/4 "2018-01-23T10:40:13Z")

</div>

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](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.

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [January 23, 2018, 3:31pm UTC](https://forum.ansible.com/t/what-should-be-the-proper-way-to-use-include-tasks-in-ansible-2-5/26535/5 "2018-01-23T15:31:31Z")

</div>

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.
