Skip to content

Molecule

hdub-tech edited this page Jul 29, 2026 · 1 revision

Problems / Solutions

molecule-plugins/vagrant does not use fqcn and fails

Error: couldn't resolve module/action 'vagrant'...

 │ [ERROR]: couldn't resolve module/action 'vagrant'. This often indicates a misspelling, missing collection, or incorrect module path.
  │ Origin:
  │   ${VIRTUAL_ENV}/lib/python3.14/site-packages/molecule_plugins/vagrant/playbooks/destroy.yml:8:7

This is documented in issue https://github.com/ansible-community/molecule-plugins/issues/301 and fixed (but not yet merged) in PR https://github.com/ansible-community/molecule-plugins/pull/314 . In the meantime....

... workaround by updating the molecule-plugins/vagrant playbooks to use fqcn

Note

This is updating all versions of python for the plugin

If using venv:

sed -i.bu 's/\([^\.]\)\(vagrant:\)/\1community.vagrant.\2/' ${VIRTUAL_ENV}/lib/python*/site-packages/molecule_plugins/vagrant/playbooks/*.yml

If not:

export MP_PATH=$( pip show molecule-plugins | grep Location | cut -d' ' -f2 )
sed -i.bu 's/\([^\.]\)\(vagrant:\)/\1community.vagrant.\2/' "${MP_PATH}"/molecule_plugins/vagrant/playbooks/*.yml

Clone this wiki locally