# Modules embedding in roles is broken

**URL:** <https://forum.ansible.com/t/modules-embedding-in-roles-is-broken/16425>\
**Category:** Ansible Developer\
**Created:** [October 3, 2014, 8:38pm UTC](https://forum.ansible.com/t/modules-embedding-in-roles-is-broken/16425 "2014-10-03T20:38:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sam\_Pierson](https://avatars.discourse-cdn.com/v4/letter/s/f475e1/32.png) [@Sam\_Pierson](https://forum.ansible.com/u/Sam_Pierson)\
**Post date:** [October 3, 2014, 8:38pm UTC](https://forum.ansible.com/t/modules-embedding-in-roles-is-broken/16425/1 "2014-10-03T20:38:45Z")

</div>

Since the submodule refactor, embedded modules do not work, unless they are used in the first play in a playbook. I just spent half a day narrowing this down, and I have created a simple example of this behavior at [https://github.com/omadahealth/example-playbook.git](https://github.com/omadahealth/example-playbook.git). I have filed this issue as [https://github.com/ansible/ansible/issues/9263](https://github.com/ansible/ansible/issues/9263).

The only difference between broken.yml and works.yml is the order of the plays:

$ ansible --version  
ansible 1.8 (devel 402d0c37b8) last updated 2014/10/03 10:21:02 (GMT -700)  
lib/ansible/modules/core: (detached HEAD cb69744bce) last updated 2014/10/03 10:21:08 (GMT -700)  
lib/ansible/modules/extras: (detached HEAD 8a4f07eecd) last updated 2014/10/03 10:21:13 (GMT -700)  
configured module search path = None

$ ansible-playbook -i inventory broken.yml  
ERROR: embedded\_module is not a legal parameter in an Ansible task or handler

$ ansible-playbook -i inventory works.yml

PLAY [Demonstrate embeded modules stopped working] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK: [role-with-embedded-module | Invoke embedded module] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
changed: [localhost]

PLAY [Play the First] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK: [another\_role | What time is it?] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
changed: [localhost]

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
localhost : ok=2 changed=2 unreachable=0 failed=0

It works file with ansible 1.7.1. Both play books run to completion.

-Sam.

**Sam Pierson**

Chief Engineer | [Omada Health](http://omadahealth.com/)  
650.422.4140 | [sam.pierson@omadahealth.com](mailto:sam.pierson@omadahealth.com)

This email may contain material that is confidential and/or privileged for the sole use of the intended recipient. Any review, reliance, or distribution by others or forwarding without express permission is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. Also note that email is not an appropriate way to send protected health information to Omada Health employees. Please use your discretion when responding to this email.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [October 3, 2014, 10:31pm UTC](https://forum.ansible.com/t/modules-embedding-in-roles-is-broken/16425/2 "2014-10-03T22:31:15Z")

</div>

Thanks, I’ve got your github ticket and we’ve up-prioritized this one so we can take a look at the devel branch!
