Ansible OEL 8 DevOps · OEL 8 · Reference

AnsibleModules — The 30 You'll Use Most

Ansible ships with 3000+ modules. You'll use about 30 of them every week. Grouped by domain, with the most useful arguments and a one-line example for each.

Every task you write is a single module call. Modules are organised into collections that are namespaced as namespace.collection.module. The most common are ansible.builtin.* (ships with the engine) and the community collections like community.mysql.* and ansible.posix.*.

3000+ modules · grouped by domain System user, group service, systemd cron, hostname mount, sysctl selinux, firewalld timezone, locale setup (facts) reboot, wait_for OS-level changes Files & Content copy, fetch template (jinja2) file, lineinfile blockinfile replace, ini_file unarchive stat, find archive, synchronize configure files Packages & Net dnf, yum apt, package pip, npm, gem get_url, uri git, subversion community.mysql.* community.postgres docker, kubernetes install & reach
ModuleWhat it doesKey args
ansible.builtin.userManage Linux usersname, state, shell, groups, append
ansible.builtin.groupManage Linux groupsname, state, gid
ansible.builtin.systemdStart / stop / enable servicesname, state, enabled
ansible.builtin.cronManage crontab entriesname, minute, hour, job
ansible.builtin.hostnameSet the hostnamename
ansible.builtin.mountMount filesystems and update fstabpath, src, fstype, state
ansible.posix.sysctlSet kernel runtime parametersname, value, sysctl_set
ansible.posix.firewalldManage firewalld rulesservice, port, state, permanent
ansible.builtin.selinuxManage SELinux modepolicy, state
ansible.builtin.timezoneSet system timezonename
ModuleWhat it doesKey args
ansible.builtin.copyPush a file to the remote hostsrc, dest, owner, group, mode, backup
ansible.builtin.templateRender a Jinja2 template, then pushsrc, dest, owner, group, mode
ansible.builtin.fetchPull a file from the remote hostsrc, dest, flat
ansible.builtin.fileSet permissions, create dirs, symlinkspath, state, mode, owner
ansible.builtin.lineinfileEnsure a single line exists in a filepath, regexp, line, state
ansible.builtin.blockinfileManage a block of text in a filepath, marker, block
ansible.builtin.replaceReplace text matching a regexpath, regexp, replace
community.general.ini_fileManage settings in INI filespath, section, option, value
ansible.builtin.unarchiveExtract zip / tar / tgz archivessrc, dest, remote_src
ansible.builtin.statInspect a file (exists, size, mtime…)path
ModuleWhat it doesKey args
ansible.builtin.dnfInstall / remove RPMs (OEL, RHEL 8+)name, state
ansible.builtin.yumSame for older RHEL/CentOSname, state
ansible.builtin.aptDebian / Ubuntu package managername, state, update_cache
ansible.builtin.pipInstall Python packagesname, virtualenv
ansible.builtin.get_urlDownload a URLurl, dest, mode, checksum
ansible.builtin.uriHTTP request from the remote hosturl, method, body, status_code
ansible.builtin.gitClone / pull a git reporepo, dest, version
community.mysql.mysql_dbCreate / drop / dump MySQL DBsname, state, target
community.mysql.mysql_userManage MySQL users + grantsname, password, priv, state
community.postgresql.postgresql_dbCreate / drop PostgreSQL DBsname, state, owner
BASH — exploring modules from the CLI
# show docs for a single module (interactive less view)
ansible-doc ansible.builtin.user

# list every module ansible knows about (3000+ lines)
ansible-doc -l

# search by keyword
ansible-doc -l | grep -i firewall

# show what arguments a module accepts (fast)
ansible-doc -s ansible.builtin.systemd
# ↑ prints a YAML snippet you can paste into a playbook
💡 Tip: Bookmark ansible-doc -s <module>. It dumps a YAML skeleton with every argument commented — copy it into your playbook and fill in the values you need.

Older playbooks used short names like user: or copy:. New code should use the fully-qualified collection name (FQCN): ansible.builtin.user:, ansible.builtin.copy:. This is unambiguous, explicit, and avoids name collisions when two collections happen to ship a module of the same name.

⚠ Warning: Ansible 2.10+ deprecated short names for modules outside ansible.builtin.*. Always FQCN community modules: community.mysql.mysql_db rather than just mysql_db. The short form may keep working, but the linter will warn.