# Ansible playbook does not work as expected, when using include\_role with with\_items to loop over multiple roles.

**URL:** <https://forum.ansible.com/t/ansible-playbook-does-not-work-as-expected-when-using-include-role-with-with-items-to-loop-over-multiple-roles/24556>\
**Category:** Ansible Project\
**Created:** [May 23, 2017, 9:02pm UTC](https://forum.ansible.com/t/ansible-playbook-does-not-work-as-expected-when-using-include-role-with-with-items-to-loop-over-multiple-roles/24556 "2017-05-23T21:02:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![uday\_shankar](https://avatars.discourse-cdn.com/v4/letter/u/51bf81/32.png) [@uday\_shankar](https://forum.ansible.com/u/uday_shankar)\
**Post date:** [May 23, 2017, 9:02pm UTC](https://forum.ansible.com/t/ansible-playbook-does-not-work-as-expected-when-using-include-role-with-with-items-to-loop-over-multiple-roles/24556/1 "2017-05-23T21:02:09Z")

</div>

$ ansible --version  
ansible 2.4.0 (devel 16d522cf2c) last updated 2017/05/22 14:49:05 (GMT -700)

# role/ServiceDeploy/tasks/main.yml

- name: SERVICE Deployment  
include\_role:  
name: ‘{{item}}’  
with\_items:
- “{{ SERVICE\_DEPLOY\_LIST }}”

# Defaults/main.yml

SERVICE\_DEPLOY\_LIST:

- ‘MicroService1’
- ‘MicroService2’
- ‘MicroService3’
- ‘MicroService4’
- ‘MicroService5’

# roles/MicroService1/tasks/main.yml

- name: Initiating Service Deployment  
include\_role:  
name: DEPLOY  
tags: MicroService1-Deploy

# roles/DEPLOY/tasks/main.yml

- Huge list of tasks

EXPECTED RESULTS  
I should be able to call multiple roles, using include\_role and with\_items. So that I can deploy all the services at the same time.

ACTUAL RESULTS - When I list tasks (–list-tasks)

It does not call Nested Roles

playbook: deploy.yml

play #1 (all): SERVICE Deployment TAGS:   
tasks:  
ServiceDeploy : Initiating Service Deployment TAGS: [ServiceDeploy]
