An Ansible role for installing and managing Conda using Miniforge, micromamba, Miniconda or Anaconda. Additionally, the role can manage the creation of a Conda environment that can be used to create a venv for Galaxy.
Warning
Use of Miniconda and Anaconda by those at organizations with more than 200 employees or contractors (including Affiliates) requires a paid Anaconda Business license.
A Conda-compatible version of Linux or macOS is required.
See defaults/main.yml for a full list.
The only required variable is miniconda_prefix, the root of the Conda installation.
The following two variables can be used to select the Conda installer and executable:
miniconda_distribution: the values can beminiforge(default),micromamba,minicondaoranacondaminiconda_executable: the default value depend on the value ofminiconda_distributionmamba: when the distribution is miniforgemicromamba: when the distribution is micromambaconda: when the distribution is miniconda or anaconda
To create arbitrary conda environments, use the variable miniconda_conda_environments as shown in the defaults, or the
example below. The role will also update these environments if you change their list of packages or package versions.
To create an env named _galaxy_ for creating a venv for Galaxy, set galaxy_conda_create_env to true. You
can then use {{ miniconda_prefix }}/envs/_galaxy_/bin/virtualenv as the value to galaxy_virtualenv_command in
galaxyproject.galaxy. This is particularly useful if you need a cross-platform copy of Python and
Galaxy's venv to be deployed on a shared filesystem between a Galaxy server and cluster that may not have matching OS
distributions and versions.
Some Conda channels require explicit acceptance of their Terms of Service (ToS) before you can use them.
You can pre-accept the ToS for specific channels by setting the following variables in your playbook or inventory:
miniconda_tos_channels:
- https://repo.anaconda.com/pkgs/main
- https://repo.anaconda.com/pkgs/r
miniconda_tos_packages:
- conda-anaconda-tos # required for Miniforge and older versions of Miniconda/AnacondaImportant: The
galaxyproject.minicondarole does not accept any Terms of Service automatically. If you need to use channels that require ToS acceptance, you must configure the variables above explicitly.
Packages from these main and r channels are subject to the
Anaconda Repository Terms of Service.
Among other restrictions, the ToS prohibits:
- heavy commercial use without a license, and
- mirroring by third parties for commercial purposes.
miniconda: Supported out of the box in recent versions.anaconda: Supported out of the box in recent versions.miniforge: Supported whenminiconda_tos_packages: [conda-anaconda-tos]is defined.micromamba: Not supported.
None
- hosts: localhost
vars:
miniconda_prefix: /conda # required
miniconda_distribution: miniforge # optional
miniconda_executable: mamba # optional
miniconda_conda_environments:
python@3.9:
channels: # optional, defaults to miniconda_channels
- conda-forge
- defaults
packages:
- python=3.9
connection: local
roles:
- galaxyproject.minicondaMIT