Ansible module

An Ansible module is a reusable unit of code that performs one specific action on a managed host, such as copying a file, installing a package or creating a user. Tasks in a Playbook call modules with arguments, and well-written modules are idempotent: they only make a change when the system isn’t already in the requested state.

Core modules ship in the ansible.builtin Collection, such as ansible.builtin.copy, ansible.builtin.file, ansible.builtin.user and ansible.builtin.command. Thousands more come from Collections for cloud, network and security platforms.

Modules change between versions. They get deprecated, renamed, moved between Collections, or gain and lose arguments. Steampunk Spotter checks every module call in a Playbook against the target ansible-core and Collection versions, so incompatible modules are caught before execution.

Dedicated modules vs command and shell. A dedicated module is idempotent, supports check mode and reports changes accurately, so it’s the better choice. Use command when no module exists, and shell only when you need pipes or redirection.