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

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

You’re looking at the module, but the actual code is an action plugin: lib/ansible/plugins/action/add_host.py

The add_host ā€œmoduleā€ and similar modules are actually ā€œactionā€ plugins since they should only run on the controller, not any inventory host.

2 Likes