Skip to content

Commit

Permalink
Merge pull request #133 from galaxyproject/structured-additional-configs
Browse files Browse the repository at this point in the history
Support specification of ancillary configs in YAML
  • Loading branch information
hexylena committed Jun 7, 2021
2 parents 615946b + 224edec commit b0916ce
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 0 deletions.
34 changes: 34 additions & 0 deletions README.md
Expand Up @@ -250,6 +250,40 @@ Options for configuring Galaxy and controlling which version is installed.
- `galaxy_clone_depth` (default: unset): Depth to use when performing git clone. Leave unspecified to clone entire
history.

**Additional config files**

Some optional configuration files commonly used in production Galaxy servers can be configured from variables:

- `galaxy_dependency_resolvers`: Populate the `dependency_resolvers_conf.yml` file. See the [sample XML
configuration][dependency_resolvers_conf_sample] for options.
- `galaxy_container_resolvers`: Populate the `container_resolvers_conf.yml` file. See the [sample XML
configuration][container_resolvers_conf_sample] for options.
- `galaxy_job_metrics_plugins`: Populate the `job_metrics_conf.yml` file. See the [sample XML
configuration][job_metrics_conf_sample] for options.

As of Galaxy 21.05 the sample configuration files for these features are in XML, but YAML is supported like so:

```yaml
galaxy_dependency_resolvers:
- type: <XML tag name>
<XML attribute name>: <XML attribute value>
```

For example:

```yaml
galaxy_dependency_resolvers:
- type: galaxy_packages
- type: conda
prefix: /srv/galaxy/conda
auto_init: true
auto_install: false
```

[dependency_resolvers_conf_sample]: https://github.com/galaxyproject/galaxy/blob/release_21.05/lib/galaxy/config/sample/dependency_resolvers_conf.xml.sample
[container_resolvers_conf_sample]: https://github.com/galaxyproject/galaxy/blob/release_21.05/lib/galaxy/config/sample/container_resolvers_conf.xml.sample
[job_metrics_conf_sample]: https://github.com/galaxyproject/galaxy/blob/release_21.05/lib/galaxy/config/sample/job_metrics_conf.xml.sample

**Path configuration**

Options for controlling where certain Galaxy components are placed on the filesystem.
Expand Down
5 changes: 5 additions & 0 deletions defaults/main.yml
Expand Up @@ -203,6 +203,11 @@ galaxy_app_config_default:
tool_config_file: "{{ galaxy_tool_config_files | join(',') }}"
shed_tool_config_file: "{{ galaxy_shed_tool_config_file }}"

# Static configs that default to .xml files in the config dir but the role writes as .yml if configured
job_metrics_config_file: "{{ galaxy_config_dir }}/job_metrics_conf.{{ (galaxy_job_metrics_plugins is defined) | ternary('yml', 'xml') }}"
dependency_resolvers_config_file: "{{ galaxy_config_dir }}/dependency_resolvers_conf.{{ (galaxy_dependency_resolvers is defined) | ternary('yml', 'xml') }}"
containers_resolvers_config_file: "{{ (galaxy_container_resolvers is defined) | ternary(galaxy_config_dir ~ '/container_resolvers_conf.yml', none) }}"

# Everything else
visualization_plugins_directory: "config/plugins/visualizations"

Expand Down
30 changes: 30 additions & 0 deletions tasks/static_setup.yml
Expand Up @@ -72,6 +72,36 @@
label: "{{ galaxy_dynamic_job_rules_dir }}/{{ ((item | dirname) != '') | ternary ((item | dirname) ~ '/', '') }}__init__.py"
with_items: "{{ galaxy_dynamic_job_rules }}"

- name: Create Galaxy job metrics configuration file
copy:
dest: "{{ galaxy_config_merged[galaxy_app_config_section].job_metrics_config_file }}"
content: |
---
## This file is managed by Ansible. ALL CHANGES WILL BE OVERWRITTEN.
{{ galaxy_job_metrics_plugins | to_nice_yaml }}
mode: "0644"
when: galaxy_job_metrics_plugins is defined

- name: Create Galaxy dependency resolvers configuration file
copy:
dest: "{{ galaxy_config_merged[galaxy_app_config_section].dependency_resolvers_config_file }}"
content: |
---
## This file is managed by Ansible. ALL CHANGES WILL BE OVERWRITTEN.
{{ galaxy_dependency_resolvers | to_nice_yaml }}
mode: "0644"
when: galaxy_dependency_resolvers is defined

- name: Create Galaxy container resolvers configuration file
copy:
dest: "{{ galaxy_config_merged[galaxy_app_config_section].containers_resolvers_config_file }}"
content: |
---
## This file is managed by Ansible. ALL CHANGES WILL BE OVERWRITTEN.
{{ galaxy_container_resolvers | to_nice_yaml }}
mode: "0644"
when: galaxy_container_resolvers is defined

- name: Create Galaxy configuration file
template:
src: "{{ galaxy_config_file_template }}"
Expand Down

0 comments on commit b0916ce

Please sign in to comment.