How to run and manage Molecule tests for Ansible roles and playbooks. Maintained at: <https://github.com/Cogni-AI-OU/.github/blob/main/.github/skills/molecule/SKILL.md>
# Run Molecule tests
molecule test
# Syntax check
molecule syntax
When running Molecule inside GitHub Codespaces or a repository's VS Code devcontainer:
.venv or venv; use the existing container Python
environment, which should already provide the required dependencies..devcontainer/requirements.txt or
.devcontainer/devcontainer.json instead of introducing a per-run Molecule install step or a separate virtual
environment.requests or docker is installed for the main container
Python but Ansible still cannot import it, check ansible --version to identify the interpreter in use. In
Codespaces/devcontainers, Ansible may run from a pipx-managed environment, so install controller-side libraries there as
well, for example with pipx inject ansible -r .devcontainer/requirements-ansible.txt.Note that this file should be updated if outdated or steps/examples are not working.