Ansible primarily works by pushing small bits of code to the nodes it connects to. These codes/programs are what we know as Ansible modules. Typically in the case of a Linux host these are copied over SSH, executed, and then removed from the node.
As stated in the Ansible Developer Guide (the best resource for all things Ansible-related):
"Ansible modules can be written in any language that can return JSON."
Modules can be used by the Ansible command-line, in a playbook, or by the Ansible API. There are already hundreds of modules that ship with Ansible version 2.4.x.
Note
Have a look at the module index on the Ansible documentation site: http://docs.ansible.com/ansible/latest/modules_by_category.html.
Currently, there are over 20 categories of modules with categories such as cloud, storage, Remote Management, and Windows.
Sometimes in spite of all the modules out there, you may need to write your own. This chapter will take you through...