# Include task from different playbook

**URL:** <https://forum.ansible.com/t/include-task-from-different-playbook/19390>\
**Category:** Ansible Project\
**Created:** [September 30, 2015, 2:21pm UTC](https://forum.ansible.com/t/include-task-from-different-playbook/19390 "2015-09-30T14:21:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jugal\_Porwal](https://avatars.discourse-cdn.com/v4/letter/j/b2d939/32.png) [@Jugal\_Porwal](https://forum.ansible.com/u/Jugal_Porwal)\
**Post date:** [September 30, 2015, 2:21pm UTC](https://forum.ansible.com/t/include-task-from-different-playbook/19390/1 "2015-09-30T14:21:54Z")

</div>

Hi,

I’m trying to include a play from different play book. The structure is as follows:

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [September 30, 2015, 2:54pm UTC](https://forum.ansible.com/t/include-task-from-different-playbook/19390/2 "2015-09-30T14:54:03Z")

</div>

Looks like you are attempting to include a playbook.

You probably want to use pre\_tasks instead of tasks for the first part to ensure things run in the order you want too. This would like something like the following:

---

<div class="post-metadata">

**Author:** ![Jugal\_Porwal](https://avatars.discourse-cdn.com/v4/letter/j/b2d939/32.png) [@Jugal\_Porwal](https://forum.ansible.com/u/Jugal_Porwal)\
**Post date:** [October 1, 2015, 5:07am UTC](https://forum.ansible.com/t/include-task-from-different-playbook/19390/3 "2015-10-01T05:07:09Z")

</div>

it still gives the same error . “no action detected in task” is there any alternative way to do it?

---

<div class="post-metadata">

**Author:** ![Jugal\_Porwal](https://avatars.discourse-cdn.com/v4/letter/j/b2d939/32.png) [@Jugal\_Porwal](https://forum.ansible.com/u/Jugal_Porwal)\
**Post date:** [October 1, 2015, 5:29am UTC](https://forum.ansible.com/t/include-task-from-different-playbook/19390/4 "2015-10-01T05:29:17Z")

</div>

The included files need not contain the hosts and the tasks modules. It works for the below file :
