Skip to content
DevOps AI ToolKit
Newsletter
All guides
AI for Ansible By James Joyner IV · · 8 min read

Ansible Error: 'The module ... was not found in configured module paths' — Cause, Fix, and Troubleshooting Guide

Quick answer

Fix Ansible's 'The module <name> was not found in configured module paths' error: missing collection, wrong FQCN, library path, or a typo in the module name.

Part of the Ansible Playbook & Module Errors hub
  • #ansible
  • #troubleshooting
  • #automation
  • #collections
Free toolkit

Fixing errors like this? Get 500 free DevOps AI prompts

500 copy-paste AI prompts for the stack you actually run — one PDF, free.

Overview

When Ansible parses a task, it resolves the module name to an actual plugin file. If it cannot find one — because the module belongs to an uninstalled collection, the name is misspelled, or library/collections paths are wrong — the play fails at load time:

ERROR! couldn't resolve module/action 'community.docker.docker_container'. This often indicates a misspelling, missing collection, or incorrect module path.

The module 'docker_container' was not found in configured module paths.

This happens before any host is contacted; it is a controller-side resolution error.

Symptoms

  • The error names a specific module and fires during play parsing, not on a host.
  • A task that worked on an older box fails after a ansible-core upgrade that split modules into collections.
  • ansible-doc <module> also reports it cannot find the module.
ansible-playbook -i inventory.ini site.yml
ERROR! The module firewalld was not found in configured module paths

Common Root Causes

1. The collection is not installed

Since Ansible 2.10, most modules live in collections. If community.general, community.docker, ansible.posix, etc. is not installed, its modules resolve to nothing.

2. Wrong or missing FQCN

Short names only resolve if the collection is on the search path. Using the fully qualified collection name (FQCN) is the reliable form.

3. Typo in the module name

sytemd, docker_containers, copyfile — a single wrong character produces this error.

4. Custom module in a library/ path Ansible does not scan

A local module exists but library in ansible.cfg (or ANSIBLE_LIBRARY) does not point at it.

How to diagnose

List what collections are installed:

ansible-galaxy collection list | grep -iE 'docker|general|posix'

Ask Ansible to resolve the module directly:

ansible-doc community.docker.docker_container >/dev/null && echo "resolves" || echo "NOT found"

Check the effective module search paths:

ansible-config dump | grep -i module
ansible --version | grep -i "module search"

Fixes

Install the collection

ansible-galaxy collection install community.docker community.general ansible.posix

Pin it in requirements.yml so CI and teammates get the same versions:

# requirements.yml
collections:
  - name: community.docker
    version: ">=3.4.0"
  - name: community.general
ansible-galaxy collection install -r requirements.yml

Use the fully qualified module name

- name: Ensure container is running
  community.docker.docker_container:
    name: web
    image: nginx:1.27
    state: started

Point Ansible at a custom module directory

# ansible.cfg
[defaults]
library = ./library
ANSIBLE_LIBRARY=./library ansible-playbook -i inventory.ini site.yml

What to watch out for

  • After upgrading ansible-core, run ansible-galaxy collection list — bare module names that used to work may now need their collection installed.
  • Execution environments (AWX/EE images) must bundle the collections; installing on the control node is not enough inside a container.
  • FQCN in every task avoids ambiguity when two collections ship a same-named module.
Free download · 368-page PDF

Get 500 Battle-Tested DevOps AI Prompts — Free

500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.

  • 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
  • Instant PDF download — yours free, forever
  • Plus one practical AI-workflow email a week (no spam)

Single opt-in · unsubscribe anytime · no spam.