-
Notifications
You must be signed in to change notification settings - Fork 18
/
galaxy_update_configs_playbook.yml
85 lines (85 loc) · 3.85 KB
/
galaxy_update_configs_playbook.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
- hosts: galaxy-handlers
become: true
vars_files:
- group_vars/all.yml
- group_vars/galaxy_etca.yml
- group_vars/VAULT
- group_vars/galaxyservers.yml
- group_vars/galaxy_etca_slurm.yml
- host_vars/galaxy.usegalaxy.org.au.yml
- host_vars/galaxy-handlers.usegalaxy.org.au.yml
- secret_group_vars/stats_server_vault
handlers:
- include: handlers/galaxy_handlers.yml
- name: galaxy gravity remote restart
become: true
become_user: ubuntu
command: 'ssh galaxy "sudo {{ galaxy_venv_dir }}/bin/galaxyctl -c {{ galaxy_config_file }} graceful"'
listen: "remote restart galaxy"
tasks:
- name: Template and copy config files
when: not ansible_user == 'jenkins_bot' # do not let the automatic process object store or restart galaxy
block:
- name: copy job_conf file
# Note: This step requires only the restart of galaxy processes running on galaxy-handlers VM
template:
src: "{{ galaxy_config_template_src_dir }}/config/galaxy_job_conf.yml.j2"
dest: "{{ galaxy_config_dir }}/job_conf.yml"
notify: restart handlers
- name: template object store conf file
# Note: This step requires the restart of all galaxy processes (galaxyctl graceful run on both VMs)
template:
src: "{{ galaxy_config_template_src_dir }}/config/galaxy_object_store_conf.yml.j2"
dest: "{{ galaxy_config_dir }}/object_store_conf.yml"
register: object_store_task
notify:
- restart galaxy
- remote restart galaxy
- name: template toolbox filters
# Note: This step requires only the restart of galaxy processes running on galaxy VM
template:
src: "{{ galaxy_config_template_src_dir }}/toolbox/filters/ga_filters.py.j2"
dest: "{{ galaxy_toolbox_filters_dir }}/ga_filters.py"
notify:
- remote restart galaxy
- name: Copy tool configuration files (static) # does not require a restart
copy:
src: "{{ galaxy_config_file_src_dir }}/config/{{ item }}"
dest: "{{ galaxy_config_dir }}/{{ item }}"
with_items:
- local_tool_conf.xml
- tool_conf.xml
- name: Copy tool configuration files (template) # does not require a restart
template:
src: "{{ galaxy_config_template_src_dir }}/config/{{ item }}.j2"
dest: "{{ galaxy_config_dir }}/{{ item }}"
with_items:
- tool_conf_interactive.xml
- name: Copy tool data table config # requires a restart of both gunicorn and handlers
copy:
src: "{{ galaxy_config_file_src_dir }}/config/{{ item }}"
dest: "{{ galaxy_config_dir }}/{{ item }}"
with_items:
- tool_data_table_conf.xml
notify:
- restart galaxy
- remote restart galaxy
# following tasks are OK for jenkins_bot
- name: Install dynamic job rules (static) # dynamic job rules tasks copied from https://github.com/galaxyproject/ansible-galaxy/blob/main/tasks/static_setup.yml
copy:
src: "{{ galaxy_dynamic_job_rules_src_dir }}/{{ item }}"
dest: "{{ galaxy_dynamic_job_rules_dir }}/{{ item }}"
mode: 0644
with_items: "{{ galaxy_dynamic_job_rules }}"
when: not item.endswith(".j2")
- name: Install dynamic job rules (template)
template:
src: "{{ galaxy_dynamic_job_rules_src_dir }}/{{ item }}"
dest: "{{ galaxy_dynamic_job_rules_dir }}/{{ item | regex_replace(regex) }}"
mode: 0644
vars:
regex: '\.j2$'
with_items: "{{ galaxy_dynamic_job_rules }}"
when: item.endswith(".j2")
# TODO: Most tasks here are not appropriate for the jenkins_bot automatic update process. To make them auto-update
# friendly (if this is actually desirable) we'd need to introduce linting for xml, templated xml and yml files