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

401 views
Skip to first unread message

Don Jackson

unread,
Apr 27, 2017, 4:26:13 PM4/27/17
to Ansible Project

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 , 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?



 

Brian Coca

unread,
Apr 27, 2017, 4:29:01 PM4/27/17
to Ansible Project
action plugins require a corresponding module with same name to work
(even if just for documentation).


----------
Brian Coca

Don Jackson

unread,
Apr 27, 2017, 4:41:11 PM4/27/17
to Ansible Project
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...

Brian Coca

unread,
Apr 27, 2017, 4:46:05 PM4/27/17
to Ansible Project
Just tested, works for me. Need more info to figure out why it does not for you.
----------
Brian Coca
Reply all
Reply to author
Forward
0 new messages