# Why some modules just have doc but there is no code?

**URL:** <https://forum.ansible.com/t/why-some-modules-just-have-doc-but-there-is-no-code/43490>\
**Category:** Get Help\
**Tags:** module, documentation, ansible-project\
**Created:** [June 20, 2025, 10:48am UTC](https://forum.ansible.com/t/why-some-modules-just-have-doc-but-there-is-no-code/43490 "2025-06-20T10:48:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kirk\_Zhang](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/kirk_zhang/32/8830_2.png) [@Kirk\_Zhang](https://forum.ansible.com/u/Kirk_Zhang)\
**Post date:** [June 20, 2025, 10:48am UTC](https://forum.ansible.com/t/why-some-modules-just-have-doc-but-there-is-no-code/43490/1 "2025-06-20T10:48:08Z")

</div>

i am new to ansible source code , but i found that `add_host.py` there is no code . i do not know why

---

<div class="post-metadata">

**Author:** ![Denney-tech](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/denney-tech/32/1556_2.png) [@Denney-tech](https://forum.ansible.com/u/Denney-tech)\
**Post date:** [June 20, 2025, 1:24pm UTC](https://forum.ansible.com/t/why-some-modules-just-have-doc-but-there-is-no-code/43490/2 "2025-06-20T13:24:57Z")

</div>

You’re looking at the module, but the actual code is an action plugin: [lib/ansible/plugins/action/add\_host.py](https://github.com/ansible/ansible/blob/devel/lib/ansible/plugins/action/add_host.py)

> [@Clarifying when to develop a module vs an action plugin](https://forum.ansible.com/t/clarifying-when-to-develop-a-module-vs-an-action-plugin/4562/2):
>
> The short answer:
> 
> - Use modules to execute the action on the target machine. Example ‘yum’ to install packages.
> - Choose an action plugin when all or part of the work should take place on the controller, the action plugin can then also call a module to finish off the work on the remote target. Example ‘template’, the templating happens on controller and the file copy is to the target, this last step is pretty complex as it is calling the copy action plugin which can call the stat, copy and file modules.

The `add_host` “module” and similar modules are actually “action” plugins since they should only run on the controller, not any inventory host.
