From 003911be65540e662b6fd1be7505c80520196494 Mon Sep 17 00:00:00 2001 From: Nate Coraor Date: Thu, 22 Feb 2024 11:40:04 -0600 Subject: [PATCH] Support installing local tools into sections --- README.md | 6 ++++-- tasks/static_setup.yml | 6 +++--- templates/local_tool_conf.xml.j2 | 9 +++++++-- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 0a86bd3..5873771 100644 --- a/README.md +++ b/README.md @@ -292,7 +292,9 @@ Options for configuring Galaxy and controlling which version is installed. - `galaxy_config_files`: List of hashes (with `src` and `dest` keys) of files to copy from the control machine. For example, to set job destinations, you can use the `galaxy_config_dir` variable followed by the file name as the `dest`, e.g. `dest: "{{ galaxy_config_dir }}/job_conf.xml"`. Make sure to add the appropriate setup within `galaxy_config` for each file added here (so, if adding `job_conf.xml` make sure that `galaxy_config.galaxy.job_config_file` points to that file). - `galaxy_config_templates`: List of hashes (with `src` and `dest` keys) of templates to fill from the control machine. - `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_src_dir` (default: `files/galaxy/tools` in the playbook). List items can either be a tool + filename, or a dictionary with keys `file`, `section_name`, and, optionally, `section_id`. If no `section_name` is + specified, tools will be placed in a section named **Local Tools**. - `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). @@ -541,4 +543,4 @@ This role was written and contributed to by the following people: - [John Chilton](https://github.com/jmchilton) - [Nate Coraor](https://github.com/natefoo) - [Helena Rasche](https://github.com/hexylena) -- [Mira Kuntz](https://github.com/mira-miracoli) \ No newline at end of file +- [Mira Kuntz](https://github.com/mira-miracoli) diff --git a/tasks/static_setup.yml b/tasks/static_setup.yml index 6e59523..340a7f2 100644 --- a/tasks/static_setup.yml +++ b/tasks/static_setup.yml @@ -43,10 +43,10 @@ - name: Install local tools copy: - src: "{{ galaxy_local_tools_src_dir }}/{{ item }}" - dest: "{{ galaxy_local_tools_dir }}/{{ item }}" + src: "{{ galaxy_local_tools_src_dir }}/{{ item.file | default(item) }}" + dest: "{{ galaxy_local_tools_dir }}/{{ item.file | default(item) }}" mode: preserve - with_items: "{{ galaxy_local_tools | default([]) }}" + loop: "{{ galaxy_local_tools | default([]) }}" when: galaxy_local_tools is defined - name: Install local_tool_conf.xml diff --git a/templates/local_tool_conf.xml.j2 b/templates/local_tool_conf.xml.j2 index 15830c6..88d802f 100644 --- a/templates/local_tool_conf.xml.j2 +++ b/templates/local_tool_conf.xml.j2 @@ -1,8 +1,13 @@ {% for tool in galaxy_local_tools %} -{% if tool.endswith('.xml') %} - +{% if tool is not mapping %} +{% set tool = {'section_name': 'Local Tools', 'file': tool} %} +{% endif %} +{% if tool.file.endswith('.xml') %} +
+ +
{% endif %} {% endfor %}