Ansible modules are discrete units of code which can be used from the command line or in a playbook task.
The modules also referred to as task plugins or library plugins in the Ansible.
Ansible ships with several modules that are called module library, which can be executed directly or remote hosts through the playbook.
Users can also write their modules. These modules can control like services, system resources, files, or packages, etc. and handle executing system commands.