This document assumes the developer has a basic understanding of python packaging, and how to install and manage python on the system executing Molecule.
Depending on the driver chosen, you may need to install additional OS packages.
- Python >= 3.9 with ansible-core >= 2.12
pip is the only supported installation method.
Ansible is not listed as a direct dependency of molecule package because we only call it as a command line tool. You may want to install it using your distribution package installer.
ansible-base pip extras were removed in molecule
4.0.0. If you used them, please switch to explicit package mention to
avoid problem with newer versions of molecule.
Keep in mind that on selinux supporting systems, if you install into a virtual environment, you may face issue 34340 even if selinux is not enabled or is configured to be permissive.
It is your responsibility to assure that soft dependencies of Ansible are available on your controller or host machines.
It is highly recommended that you install molecule in a virtual environment. This will provide a modern copy of setuptools which is mandatory in order for molecule to be installed successfully and function correctly. If you cannot use a virtual environment then you can attempt a package upgrade with the following:
Depending on the driver chosen, you may need to install additional
python packages. See the driver's documentation or
is created when initializing a new scenario.
Molecule does not include ansible-lint (nor does the lint extra), but is easily installed separately:
Molecule uses the \"delegated\" driver by default. Other drivers can be installed separately from PyPI, most of them being included in molecule-plugins package. If you would like to use podman as the molecule driver, the installation command would look like this:
If you upgrade molecule from previous versions, make sure to remove
previously installed drivers like for instance
molecule-vagrant since those are now available in the
Installing molecule package also installed its main script
PATH. Users should know that molecule can also be called as
a python module, using
python -m molecule .... This alternative method
has some benefits:
- allows to explicitly control which python interpreter is used by molecule
- allows molecule installation at user level without even needing to
have the script in
Molecule is built into a container image by the Ansible Creator Execution
Any questions or bugs related to use of Molecule from within a container should be addressed by the Ansible Creator Execution Environment project.
Due to the rapid pace of development on this tool, you might want to install and update a bleeding-edge version of Molecule from Git. Follow the instructions below to do the initial install and subsequent updates.
The package distribution that you'll get installed will be autogenerated and will contain a commit hash information making it easier to refer to certain unstable version should the need to send a bug report arise.