/
static_setup.yml
85 lines (72 loc) · 3.22 KB
/
static_setup.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
---
# Manage static Galaxy configuration files
- name: Static config setup
block:
- name: Ensure Galaxy version is set
include_tasks: _inc_galaxy_version.yml
when: __galaxy_major_version is undefined
- name: Install additional Galaxy config files (static)
copy:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
backup: "{{ galaxy_backup_configfiles }}"
with_items: "{{ galaxy_config_files }}"
notify:
- "{{ galaxy_restart_handler_name }}"
- name: Install additional Galaxy config files (template)
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
backup: "{{ galaxy_backup_configfiles }}"
with_items: "{{ galaxy_config_templates }}"
notify:
- "{{ galaxy_restart_handler_name }}"
- name: Install local tools
copy:
src: "{{ galaxy_local_tools_src_dir }}/{{ item }}"
dest: "{{ galaxy_local_tools_dir }}/{{ item }}"
with_items: "{{ galaxy_local_tools | default([]) }}"
when: galaxy_local_tools is defined
- name: Install local_tool_conf.xml
template:
src: local_tool_conf.xml.j2
dest: "{{ galaxy_config_dir }}/local_tool_conf.xml"
when: galaxy_local_tools is defined
- name: Append local_tool_conf.xml to tool_config_file Galaxy config option
set_fact:
galaxy_tool_config_files: "{{ galaxy_tool_config_files }} + ['{{ galaxy_config_dir ~ '/local_tool_conf.xml' }}']"
when: galaxy_local_tools is defined
- name: Append shed_tool_conf.xml to tool_config_file Galaxy config option
set_fact:
galaxy_tool_config_files: "{{ galaxy_tool_config_files }} + ['{{ galaxy_shed_tool_config_file }}']"
when: __galaxy_major_version is version('19.09', '<') and galaxy_shed_tool_config_file not in galaxy_tool_config_files
- name: Ensure dynamic job rules paths exists
file:
path: "{{ galaxy_dynamic_job_rules_dir }}/{{ item | dirname }}"
state: directory
loop_control:
label: "{{ galaxy_dynamic_job_rules_dir }}/{{ item | dirname }}"
with_items: "{{ galaxy_dynamic_job_rules }}"
- name: Install dynamic job rules
copy:
src: "{{ galaxy_dynamic_job_rules_src_dir }}/{{ item }}"
dest: "{{ galaxy_dynamic_job_rules_dir }}/{{ item }}"
with_items: "{{ galaxy_dynamic_job_rules }}"
- name: Ensure dynamic rule __init__.py's exist
copy:
content: ""
dest: "{{ galaxy_dynamic_job_rules_dir }}/{{ item | dirname }}/__init__.py"
force: no
loop_control:
label: "{{ galaxy_dynamic_job_rules_dir }}/{{ ((item | dirname) != '') | ternary ((item | dirname) ~ '/', '') }}__init__.py"
with_items: "{{ galaxy_dynamic_job_rules }}"
- name: Create Galaxy configuration file
template:
src: "{{ galaxy_config_file_template }}"
dest: "{{ galaxy_config_file }}"
backup: "{{ galaxy_backup_configfiles }}"
notify:
- "{{ galaxy_restart_handler_name }}"
remote_user: "{{ galaxy_remote_users.privsep | default(__galaxy_remote_user) }}"
become: "{{ true if galaxy_become_users.privsep is defined else __galaxy_become }}"
become_user: "{{ galaxy_become_users.privsep | default(__galaxy_become_user) }}"