Skip to content

Commit

Permalink
Split the mutable config backup tasks out from the usegalaxy role int…
Browse files Browse the repository at this point in the history
…o a usegalaxy_backup role for faster runtimes after tool installs. Fixes #40.
  • Loading branch information
natefoo committed Oct 2, 2017
1 parent b64ae9b commit 0a38e3f
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 15 deletions.
12 changes: 12 additions & 0 deletions env/common/backup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---

- name: Backup Galaxy mutable configs
hosts: "galaxyservers[0]"
remote_user: "{{ galaxy_user }}"
vars:
instance_root: "{{ galaxy_root }}"
galaxy_config: "{{ galaxy_config_hash }}"
roles:
- role: usegalaxy_backup
tags:
- no-restart
1 change: 1 addition & 0 deletions env/common/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
# fetch and distribute mutable configs (needs the galaxy_mutable_configs
# var set in galaxyproject.galaxy)
- role: usegalaxy
- role: usegalaxy_backup
tags:
- no-restart

Expand Down
1 change: 1 addition & 0 deletions env/main/backup.yml
1 change: 1 addition & 0 deletions env/test/backup.yml
15 changes: 0 additions & 15 deletions roles/usegalaxy/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@
with_indexed_items: "{{ galaxy_mutable_configs }}"
when: not mutable_configs_stat_out.results[item.0].stat.exists

- name: Fetch mutable configs from master host
synchronize:
mode: pull
src: "{{ item.dest }}"
dest: "files/galaxy/var/{{ item.dest | basename }}"
with_items: "{{ galaxy_mutable_configs }}"
when: inventory_hostname == groups['galaxyservers'][0]

- name: Check for tool panel layout existence
stat:
path: "{{ galaxy_config['app:main']['integrated_tool_panel_config'] }}"
Expand All @@ -37,13 +29,6 @@
dest: "{{ galaxy_config['app:main']['integrated_tool_panel_config'] }}"
when: not tool_panel_stat_out.stat.exists

- name: Fetch tool panel layout
synchronize:
mode: pull
src: "{{ galaxy_config['app:main']['integrated_tool_panel_config'] }}"
dest: "files/galaxy/var/integrated_tool_panel.xml"
when: inventory_hostname == groups['galaxyservers'][0]

#- name: Distribute mutable configs to slave hosts
# synchronize: src=files/galaxy/{{ galaxy_instance_hostname }}/var/{{ item.dest | basename }} dest={{ item.dest }}
# with_items: galaxy_mutable_configs
Expand Down
1 change: 1 addition & 0 deletions roles/usegalaxy_backup/defaults
16 changes: 16 additions & 0 deletions roles/usegalaxy_backup/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---

- name: Fetch mutable configs from master host
synchronize:
mode: pull
src: "{{ item.dest }}"
dest: "files/galaxy/var/{{ item.dest | basename }}"
with_items: "{{ galaxy_mutable_configs }}"
when: inventory_hostname == groups['galaxyservers'][0]

- name: Fetch tool panel layout
synchronize:
mode: pull
src: "{{ galaxy_config['app:main']['integrated_tool_panel_config'] }}"
dest: "files/galaxy/var/integrated_tool_panel.xml"
when: inventory_hostname == groups['galaxyservers'][0]

0 comments on commit 0a38e3f

Please sign in to comment.