Skip to content

Instantly share code, notes, and snippets.

@natefoo
Created December 14, 2022 04:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save natefoo/4ed55868461ea795aa14cdbaba589f72 to your computer and use it in GitHub Desktop.
Save natefoo/4ed55868461ea795aa14cdbaba589f72 to your computer and use it in GitHub Desktop.
Playbook for installing Galaxy w/ galaxyproject.miniconda for deps and the Galaxy venv python
---
- hosts: galaxyservers
become: true
become_user: root
vars_files:
- group_vars/secret.yml
pre_tasks:
- name: Install Dependencies
apt:
#name: ['acl', 'bzip2', 'git', 'make', 'python3-psycopg2', 'tar', 'virtualenv']
name: ['acl', 'bzip2', 'git', 'make', 'python3-psycopg2', 'tar', 'python3-venv', 'python3-setuptools']
cache_valid_time: 3600
- name: Conda package cache tempdir
tempfile:
state: directory
suffix: conda_pkg_cache
register: __conda_pkg_cache_tmpdir
post_tasks:
- name: Remove conda package cache tempdir
file:
path: "{{ __conda_pkg_cache_tmpdir.path }}"
state: absent
roles:
- galaxyproject.postgresql
- role: galaxyproject.postgresql_objects
become: true
become_user: postgres
# precreate user and paths so we can install conda
- role: galaxyproject.galaxy
galaxy_create_user: true
galaxy_manage_paths: true
galaxy_manage_clone: false
galaxy_manage_download: false
galaxy_manage_existing: false
galaxy_manage_static_setup: false
galaxy_manage_mutable_setup: false
galaxy_manage_database: false
galaxy_fetch_dependencies: false
galaxy_build_client: false
galaxy_manage_errordocs: false
galaxy_backup_configfiles: false
galaxy_manage_gravity: false
galaxy_manage_systemd: false
galaxy_manage_systemd_reports: false
galaxy_manage_cleanup: false
galaxy_systemd_mode: gravity
# install conda as the galaxy user
- role: galaxyproject.miniconda
become: true
become_user: "{{ galaxy_user.name }}"
# install python from the galaxy conda as root
- role: galaxyproject.miniconda
miniconda_conda_environments:
"{{ galaxy_root }}/python":
copy: true
packages:
- python=3.9
environment:
# don't install into conda pkgs/ dir as root
CONDA_PKGS_DIRS: "{{ __conda_pkg_cache_tmpdir.path }}"
# install galaxy
- galaxyproject.galaxy
- galaxyproject.nginx
- galaxyproject.gxadmin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment