# How to call an action plugin/module embedded in a role?

**URL:** <https://forum.ansible.com/t/how-to-call-an-action-plugin-module-embedded-in-a-role/24343>\
**Category:** Ansible Project\
**Created:** [April 27, 2017, 8:26pm UTC](https://forum.ansible.com/t/how-to-call-an-action-plugin-module-embedded-in-a-role/24343 "2017-04-27T20:26:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Don\_Jackson](https://avatars.discourse-cdn.com/v4/letter/d/ac8455/32.png) [@Don\_Jackson](https://forum.ansible.com/u/Don_Jackson)\
**Post date:** [April 27, 2017, 8:26pm UTC](https://forum.ansible.com/t/how-to-call-an-action-plugin-module-embedded-in-a-role/24343/1 "2017-04-27T20:26:13Z")

</div>

I would like to embed some action plugins within a role, and then call those plugins from a top level playbook, after the role has been invoked/referenced.

AFAICT, I have followed these instructions [http://docs.ansible.com/ansible/playbooks\_roles.html#embedding-modules-and-plugins-in-roles](http://docs.ansible.com/ansible/playbooks_roles.html#embedding-modules-and-plugins-in-roles) , but when I attempt to call the action plugin from my playbook, it can’t find it, and gives:

> ERROR! no action detected in task. This often indicates a misspelled module name, or incorrect module path.

If I set my ANSIBLE\_LIBRARY and ANSIBLE\_ACTION\_PLUGINS varaibles to reach into the role, then it works.

I’m running Ansible 2.2.2.0 on macOS Sierra, installed via pip.

Any ideas how to get this working?

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [April 27, 2017, 8:28pm UTC](https://forum.ansible.com/t/how-to-call-an-action-plugin-module-embedded-in-a-role/24343/2 "2017-04-27T20:28:46Z")

</div>

action plugins require a corresponding module with same name to work  
(even if just for documentation).

---

<div class="post-metadata">

**Author:** ![Don\_Jackson](https://avatars.discourse-cdn.com/v4/letter/d/ac8455/32.png) [@Don\_Jackson](https://forum.ansible.com/u/Don_Jackson)\
**Post date:** [April 27, 2017, 8:41pm UTC](https://forum.ansible.com/t/how-to-call-an-action-plugin-module-embedded-in-a-role/24343/3 "2017-04-27T20:41:11Z")

</div>

Yes, I have an associated module.

My action-plugin/module works perfectly fine when not embedded within a role, and when embedded in a role it also works if I set my ANSIBLE\_LIBRARY and ANSIBLE\_ACTION\_PLUGINS to reach inside the role.

The documentation suggests that once the role has been accessed with a playbook, then embedded modules/plugins are then available, but that is not what I am seeing, and that is what I am asking about…

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [April 27, 2017, 8:45pm UTC](https://forum.ansible.com/t/how-to-call-an-action-plugin-module-embedded-in-a-role/24343/4 "2017-04-27T20:45:59Z")

</div>

Just tested, works for me. Need more info to figure out why it does not for you.
