# action plugin vs module

**URL:** <https://forum.ansible.com/t/action-plugin-vs-module/16707>\
**Category:** Ansible Project\
**Created:** [November 6, 2014, 10:34am UTC](https://forum.ansible.com/t/action-plugin-vs-module/16707 "2014-11-06T10:34:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dariusz\_C](https://avatars.discourse-cdn.com/v4/letter/d/b5e925/32.png) [@Dariusz\_C](https://forum.ansible.com/u/Dariusz_C)\
**Post date:** [November 6, 2014, 10:34am UTC](https://forum.ansible.com/t/action-plugin-vs-module/16707/1 "2014-11-06T10:34:07Z")

</div>

Could You help and tell me the difference between an action plugin and a module? Why is an action plugin ‘synchronize’ and a module ‘synchronize’ at the same time? Thanks.

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [November 6, 2014, 4:11pm UTC](https://forum.ansible.com/t/action-plugin-vs-module/16707/2 "2014-11-06T16:11:24Z")

</div>

See

[http://docs.ansible.com/intro\_configuration.html#action-plugins](http://docs.ansible.com/intro_configuration.html#action-plugins)

In essence, action plugins provide services to modules and are used for various things including the abilty to let different modules share logic. Modules provide a mechanism with a defined interface. For example the ability to copy files to a remote machine is a useful capability for lots of modules (template, unarchive), so the action plugins let other modules use the logic in the copy module.

---

<div class="post-metadata">

**Author:** ![Dariusz\_C](https://avatars.discourse-cdn.com/v4/letter/d/b5e925/32.png) [@Dariusz\_C](https://forum.ansible.com/u/Dariusz_C)\
**Post date:** [November 6, 2014, 4:31pm UTC](https://forum.ansible.com/t/action-plugin-vs-module/16707/3 "2014-11-06T16:31:13Z")

</div>

So if I’m understanding it right, synchronize module should invoke synchronize action plugin to meet DRY principle.

[module synchronize.py](https://github.com/ansible/ansible-modules-core/blob/devel/files/synchronize.py)  
[action\_plugin synchronize.py](https://github.com/ansible/ansible/blob/devel/lib/ansible/runner/action_plugins/synchronize.py)

W dniu czwartek, 6 listopada 2014 17:11:24 UTC+1 użytkownik J Hawkesworth napisał:

---

<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:** [November 7, 2014, 2:20pm UTC](https://forum.ansible.com/t/action-plugin-vs-module/16707/4 "2014-11-07T14:20:27Z")

</div>

Action plugins call modules of the same name sometimes, not the other way around.

This has nothing to do with “Don’t Repeat Yourself”.
