ansible-lint does not only lint the role but the molecule scenario as well, and the scenario creates its containers with community.docker. Only the runtime requirements of the role were installed, so the linter could not resolve community.docker.docker_container and failed the syntax check. The collection list of the scenario is a superset of the runtime requirements, therefore it is used instead of adding a test only dependency to requirements.yml. Co-authored-by: Copilot <copilot@github.com>