Interview Prep/Ansible/Cloud, AWX, Windows and Molecule

A playbook works locally but fails in AWX with `couldn't resolve module/action 'community.mysql.mysql_db'`

IntermediateTroubleshootingCloud, AWX, Windows and Molecule
Answer

Likely causes → AWX runs jobs inside an execution environment container, not with your laptop's collections. The EE does not include community.mysql, and the project has no collections/requirements.yml for AWX to install during project sync.

Fix → Choose one of these:

  • Add collections/requirements.yml to the project. AWX installs it on project sync if collection installs are allowed.
  • Build a custom EE:
# execution-environment.yml (ansible-builder v3)
version: 3
images:
  base_image:
    name: quay.io/ansible/awx-ee:latest
dependencies:
  galaxy: requirements.yml
  python: requirements.txt
  system: bindep.txt
ansible-builder build -t registry.internal/acme-ee:1.4.0

Prevent → Test locally with ansible-navigator run --eei registry.internal/acme-ee:1.4.0 so local runs match AWX.

All Ansible questions Roadmap: Ansible

More on Cloud, AWX, Windows and Molecule