# multiple tasks\_from in a single include\_role

**URL:** <https://forum.ansible.com/t/multiple-tasks-from-in-a-single-include-role/30613>\
**Category:** Ansible Project\
**Created:** [June 20, 2019, 1:19pm UTC](https://forum.ansible.com/t/multiple-tasks-from-in-a-single-include-role/30613 "2019-06-20T13:19:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Punit\_Jain](https://avatars.discourse-cdn.com/v4/letter/p/e56c9b/32.png) [@Punit\_Jain](https://forum.ansible.com/u/Punit_Jain)\
**Post date:** [June 20, 2019, 1:19pm UTC](https://forum.ansible.com/t/multiple-tasks-from-in-a-single-include-role/30613/1 "2019-06-20T13:19:34Z")

</div>

Hi,

I have a role with multiple task files and I include only few of them in my different playbook

I did below but it gives an error:

tasks:

- name: check configuration  
include\_role:  
name: config\_check  
tasks\_from: “{{ item }}”  
with\_items:
- ldap
- dns

it gave an error:  
ERROR! invalid options for include\_role: with\_items

so I try below :

tasks:

- name: check ldap configuration  
include\_role:  
name: config\_check

tasks\_from: ldap

- name: check dns configuration  
include\_role:  
name: config\_check

tasks\_from: dns

Is this correct design approach ?

Thanks and regards  
Punit

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [June 20, 2019, 2:37pm UTC](https://forum.ansible.com/t/multiple-tasks-from-in-a-single-include-role/30613/2 "2019-06-20T14:37:03Z")

</div>

Approach ok but your indentation is off.

with\_items should be at the same level as include\_role.
