Skip to content

Instantly share code, notes, and snippets.

@afgane
Last active June 23, 2016 18:17
Show Gist options
  • Save afgane/6dfdbecf71d4fcc8795a0177295e5eea to your computer and use it in GitHub Desktop.
Save afgane/6dfdbecf71d4fcc8795a0177295e5eea to your computer and use it in GitHub Desktop.
Deploying a Galaxy server via Ansible roles.

Retrieve requirements.yml file and install all the roles with:

ansible-galaxy install -r requirements.yml -p roles

Create an inventory file such as the following

[my-galaxy-server]
129.114.18.39 ansible_ssh_private_key_file=key_pair.pem ansible_ssh_user=eafgan  # Jetstream via Atmo

If Ansible 2.1.0+ is installed on the host, before running the playbook, download ansible.cfg file to the same dir as the playbook. Run the playbook with

ansible-playbook -i inventory playbook.yml
[defaults]
allow_world_readable_tmpfiles=True
callback_whitelist = profile_tasks
- hosts: my-galaxy-server
become: yes
become_user: root
vars:
galaxyFS_base_dir: /opt/galaxy
galaxy_server_dir: "{{ galaxyFS_base_dir}}/galaxy-app"
galaxy_mutable_config_dir: "{{ galaxyFS_base_dir }}/config"
galaxy_user_name: galaxy
galaxy_db_port: 5432
galaxy_config_dir: "{{ galaxy_server_dir }}/config"
galaxy_shed_tools_dir: "{{ galaxyFS_base_dir }}/shed_tools"
roles:
- name: galaxy-os
postgres_user_uid: 1110
install_maintainance_packages: no
configure_docker: no
- name: galaxy-nginx
- name: galaxy-psql
postgresql_conf:
port: "{{ galaxy_db_port }}"
- name: galaxy-psql-objects
become_user: postgres
postgresql_objects_port: "{{ galaxy_db_port }}"
postgresql_objects_users:
- name: galaxy
role_attr_flags: CREATEDB,LOGIN
password: gxydbpwd
- name: galaxyftp
password: gxyftppwd
role_attr_flags: LOGIN
postgresql_objects_databases:
- name: galaxy
owner: galaxy
- name: bash_command
cmd: 'mkdir -p /opt/galaxy/galaxy-app'
- name: bash_command
cmd: 'chown -R galaxy:galaxy /opt/galaxy'
- name: galaxy
become_user: galaxy
galaxy_vcs: git
galaxy_changeset_id: release_16.04
galaxy_config:
"server:main":
port: 8080
host: 127.0.0.1
"app:main":
admin_users: cloud@galaxyproject.org
database_connection: postgresql://{{ galaxy_user_name }}:gxydbpwd@localhost:{{ galaxy_db_port }}/galaxy
install_database_connection: sqlite:///{{ galaxy_mutable_config_dir }}/galaxy_install_db.sqlite?isolation_level=IMMEDIATE
nginx_x_accel_redirect_base: /_x_accel_redirect
nginx_upload_store: "{{ galaxyFS_base_dir }}/upload_store"
nginx_upload_path: /_upload
len_file_path: "{{ galaxy_mutable_config_dir }}/len"
builds_file_path: "{{ galaxy_server_dir }}/tool-data/shared/ucsc/builds.txt"
"filter:gzip":
use: egg:Paste#gzip
"filter:proxy-prefix":
use: egg:PasteDeploy#prefix
prefix: /galaxy
# galaxy_mutable_configs:
# - src: "{{ galaxy_server_dir }}/config/migrated_tools_conf.xml.sample"
# dest: "{{ galaxy_config['app:main']['migrated_tools_config'] if galaxy_config is defined and 'app:main' in galaxy_config and 'migrated_tools_config' in galaxy_config['app:main'] else galaxy_config_default['app:main']['migrated_tools_config'] }}"
# - src: "{{ galaxy_server_dir }}/config/shed_data_manager_conf.xml.sample"
# dest: "{{ galaxy_config['app:main']['shed_data_manager_config_file'] if galaxy_config is defined and 'app:main' in galaxy_config and 'shed_data_manager_config_file' in galaxy_config['app:main'] else galaxy_config_default['app:main']['shed_data_manager_config_file'] }}"
# - src: "{{ galaxy_server_dir }}/config/shed_tool_data_table_conf.xml.sample"
# dest: "{{ galaxy_config['app:main']['shed_tool_data_table_config'] if galaxy_config is defined and 'app:main' in galaxy_config and 'shed_tool_data_table_config' in galaxy_config['app:main'] else galaxy_config_default['app:main']['shed_tool_data_table_config'] }}"
# - src: "{{ galaxy_server_dir }}/config/datatypes_conf.xml.sample"
# dest: "{{ galaxy_config['app:main']['datatypes_config_file'] if galaxy_config is defined and 'app:main' in galaxy_config and 'datatypes_config_file' in galaxy_config['app:main'] else galaxy_config_default['app:main']['datatypes_config_file'] }}"
# - src: "{{ galaxy_server_dir }}/config/tool_data_table_conf.xml.sample"
# dest: "{{ galaxy_config['app:main']['tool_data_table_config_path'] }}"
# - src: "{{ galaxy_server_dir }}/config/tool_conf.xml.sample"
# dest: "{{ galaxy_config_dir }}/tool_conf.xml"
- name: trackster
become_user: galaxy
# - name: galaxy-tools
# galaxy_tools_galaxy_instance_url: ''
# galaxy_tools_api_key: ''
# galaxy_tools_tool_list_files: ['tool_list.yaml.sample'] # Copy this file to root dir
- src: https://github.com/galaxyproject/ansible-galaxy-os
name: galaxy-os
- src: https://github.com/galaxyproject/ansible-nginx
name: galaxy-nginx
- src: https://github.com/galaxyproject/ansible-postgresql
name: galaxy-psql
- src: https://github.com/natefoo/ansible-postgresql-objects
name: galaxy-psql-objects
- src: https://github.com/galaxyproject/ansible-galaxy
name: galaxy
- src: https://github.com/galaxyproject/ansible-trackster
name: trackster
- src: https://github.com/dkreuer/ansible-role-bash-cmd
name: bash_command
version: patch-1
- src: https://github.com/galaxyproject/ansible-galaxy-tools
name: galaxy-tools
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment