

If an SCM inventory source does not have a venv selected, it can use the venv of its linked project. Jobs using that inventory follow their own rules and will not use this venv. You can set the custom venv on an inventory source to run inventory updates in that venv. Once you have created a custom virtualenv, you can assign it at the Organization, Project, or Job Template level to use it in job runs. For setting up custom virtual environments in containers, refer to the OpenShift Deployment and Configuration section of the Ansible Tower Administration Guide.

If you are using a custom virtual environment, it needs to also be copied or replicated on any isolated node you would be using, not just on the Tower node. Custom virtualenvs are supported on isolated instances. In a clustered Tower installation, you need to ensure that the same custom virtualenv exists on every local file system at /opt/my-envs/. $ sudo /var/lib/awx/venv/ansible/bin/pip freeze Tower also pre-installs a variety of third-party library/SDK support into this virtualenv for its integration points with a variety of cloud providers (such as EC2, OpenStack, Azure, etc.) Periodically, you may want to add additional SDK support into this virtualenv, which is described in further detail below. This allows you to choose how you run your inventory imports, as inventory sources use custom virtual environments. For more information on virtualenv, see the Python Guide to Virtual Environments and the Python virtualenv project itself.īy default, the virtualenv is located at /var/lib/awx/venv/ansible on the file system but you can create your own custom directories and use them in inventory imports. This allows Tower to run in a stable environment, while allowing you to add or update modules to your Ansible Python environment as necessary to run your playbooks. Ansible Tower creates two virtualenvs during installation–one is used to run Tower, while the other is used to run Ansible. Virtualenv works by simply creating a folder which contains all of the necessary executables and dependencies for a specific version of Python. Virtualenv creates isolated Python environments to avoid problems caused by conflicting dependencies and differing versions.
