Skip to content

Commit

Permalink
Support for installing dynamic job rules
Browse files Browse the repository at this point in the history
  • Loading branch information
natefoo committed Jan 27, 2019
1 parent 9eb7699 commit ba8284d
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,12 @@ Options for configuring Galaxy and controlling which version is installed.
- `galaxy_local_tools`: List of local tool files or directories to copy from the control machine, relative to
`galaxy_local_tools_src_dir` (default: `files/galaxy/tools` in the playbook).
- `galaxy_local_tools_dir`: Directory on the Galaxy server where local tools will be installed.
- `galaxy_dynamic_job_rules`: List of dynamic job rules to copy from the control machine, relative to
`galaxy_dynamic_job_rules_src_dir` (default: `files/galaxy/dynamic_job_rules` in the playbook).
- `galaxy_dynamic_job_rules_dir` (default: `{{ galaxy_server_dir }}/lib/galaxy/jobs/rules`): Directory on the Galaxy
server where dynamic job rules will be installed. If changed from the default, ensure the directory is on Galaxy's
`$PYTHONPATH` (e.g. in `{{ galaxy_venv_dir }}/lib/python2.7/site-packages`) and configure the dynamic rules plugin in
`job_conf.xml` accordingly.
- `galaxy_repo` (default: `https://github.com/galaxyproject/galaxy.git`): Upstream Git repository from which Galaxy
should be cloned.
- `galaxy_commit_id` (default: `master`): A commit id, tag, branch, or other valid Git reference that Galaxy should be
Expand Down
9 changes: 9 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,15 @@ galaxy_privsep_dirs:
# Local (relative to playbook) path to local tools
galaxy_local_tools_src_dir: files/galaxy/tools

# Local (relative to playbook) path to dynamic job rules
galaxy_dynamic_job_rules_src_dir: files/galaxy/dynamic_job_rules

# Remote path to dynamic job rules (must be on Galaxy's $PYTHONPATH if not the default)
galaxy_dynamic_job_rules_dir: "{{ galaxy_server_dir }}/lib/galaxy/jobs/rules"

# List of dynamic rules to install
galaxy_dynamic_job_rules: []

#
# Version control
#
Expand Down
23 changes: 23 additions & 0 deletions tasks/static_setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,29 @@
galaxy_tool_config_files: "{{ galaxy_tool_config_files }} + ['{{ galaxy_config_dir ~ '/local_tool_conf.xml' }}']"
when: galaxy_local_tools is defined

- 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 }}"
Expand Down

0 comments on commit ba8284d

Please sign in to comment.