Skip to content

Commit

Permalink
Add Nextflow role
Browse files Browse the repository at this point in the history
  • Loading branch information
m-bull committed Feb 3, 2025
1 parent c60e3d1 commit 3d16935
Show file tree
Hide file tree
Showing 8 changed files with 78 additions and 2 deletions.
13 changes: 13 additions & 0 deletions roles/apptainer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# apptainer

Install and configure Apptainer on RedHat and Debian systems.

## Usage

| Name | Description | Default |
| ---- | ----------- | ------- |
|`apptainer_deb_repository` | DEB repository to install Apptainer from | "ppa:apptainer/ppa" |
|`apptainer_deb_package` | Apptainer DEB package to install | "apptainer=1.3.4*" |
|`apptainer_rpm_repository` | RPM repository to install Apptainer from | UNSET |
|`apptainer_rpm_package` | Apptainer RPM package to install | "apptainer=1.3.6" |
|`apptainer_config_overrides` | Configuration overrides to apply to Apptainer config| `[]` |
5 changes: 4 additions & 1 deletion roles/apptainer/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ apptainer_rpm_repository:

apptainer_rpm_package: "apptainer-1.3.6"

apptainer_config_overrides:
# e.g.
# - "directive": "mount tmp"
# "value": "no"
apptainer_config_overrides: []
1 change: 0 additions & 1 deletion roles/apptainer/tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
command:
cmd: apptainer config global --set "{{ item.directive }}" "{{ item.value }}"
become: true
when: apptainer_config_overrides
loop: apptainer_config_overrides
loop_control:
label: "{{ item.directive }} = {{ item.value }}"
12 changes: 12 additions & 0 deletions roles/nextflow/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# apptainer

Install and configure Nextflow on RedHat and Debian systems.

## Usage

| Name | Description | Default |
| ---- | ----------- | ------- |
|`nextflow_openjdk_package_name` | Name of a package that provides Java JDK > 11 | "java-21-openjdk" or "openjdk-21-jdk" |
|`nextflow_version` | Nextflow version to install | "v24.10.4" |
|`nextflow_executable_url` | URL to download Nextflow from | https://github.com/nextflow-io/nextflow/releases/download/{{ nextflow_version }}/nextflow |
|`nextflow_skel_config` | Config to add to /etc/skel/.nextflow/config | UNSET |
14 changes: 14 additions & 0 deletions roles/nextflow/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---

nextflow_openjdk_package_name: >-
{{
'java-21-openjdk'
if ansible_os_family == 'RedHat'
else 'openjdk-21-jdk'
}}
nextflow_version: "v24.10.4"

nextflow_executable_url: https://github.com/nextflow-io/nextflow/releases/download/{{ nextflow_version }}/nextflow

nextflow_skel_config:
15 changes: 15 additions & 0 deletions roles/nextflow/tasks/configure.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---

- name: Create Nextflow config directory in /etc/skel
file:
state: directory
path: /etc/skel/.nextflow
when: nextflow_skel_config
become: true

- name: Write Nextflow config file to /etc/skel
copy:
dest: /etc/skel/.nextflow/config
content: "{{ nextflow_skel_config }}"
become: true
when: nextflow_skel_config
13 changes: 13 additions & 0 deletions roles/nextflow/tasks/install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---

- name: Install OpenJDK
package:
name: "{{ nextflow_openjdk_package_name }}"
become: true

- name: Install Nextflow
get_url:
url: "{{ nextflow_executable_url }}"
dest: /usr/local/bin/nextflow
mode: u=rwx,g=rx,o=rx
become: true
7 changes: 7 additions & 0 deletions roles/nextflow/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---

- name: Install Nextflow
include_tasks: install.yml

- name: Configure Nextflow
import_tasks: configure.yml

0 comments on commit 3d16935

Please sign in to comment.