diff --git a/roles/xnat/defaults/main.yml b/roles/xnat/defaults/main.yml index 82b6ef66..4ea1371b 100644 --- a/roles/xnat/defaults/main.yml +++ b/roles/xnat/defaults/main.yml @@ -60,3 +60,6 @@ xnat_config_logo: /images/logo.png # use the default XNAT logo # Pipeline engine xnat_pipeline_engine_enabled: true + +# Note that AutoRun is currently required for session archive notifications +xnat_autorun_enabled: false diff --git a/roles/xnat/tasks/configure.yml b/roles/xnat/tasks/configure.yml index aaf80953..8878a015 100644 --- a/roles/xnat/tasks/configure.yml +++ b/roles/xnat/tasks/configure.yml @@ -203,3 +203,17 @@ validate_certs: "{{ ssl.validate_certs }}" status_code: 200, 201, 304 loop: "{{ automation_scripts | default([]) }}" + +- name: Enable AutoRun pipeline + ansible.builtin.uri: + url: "{{ web_server.url }}/xapi/pipelines" + user: "{{ xnat_service_admin.username }}" + password: "{{ xnat_service_admin.password }}" + method: POST + body_format: json + body: + autoRunEnabled: true + allowAutoRunProjectOverride: false + validate_certs: "{{ ssl.validate_certs }}" + status_code: 200 + when: xnat_autorun_enabled diff --git a/roles/xnat_container_service/tasks/main.yml b/roles/xnat_container_service/tasks/main.yml index 3b82edb3..01e6e484 100644 --- a/roles/xnat_container_service/tasks/main.yml +++ b/roles/xnat_container_service/tasks/main.yml @@ -63,4 +63,16 @@ vars: container_registry: "{{ item }}" loop: "{{ xnat_container_service_hubs | default([]) }}" - when: external_storage_drive is defined + +- name: Pull containers + ansible.builtin.uri: + url: + "{{ web_server.url }}/xapi/docker/hubs/{{ item.hub_name }}/pull?image={{ + item.image }}&save-commands=true" + user: "{{ xnat_service_admin.username }}" + password: "{{ xnat_service_admin.password }}" + method: POST + body_format: json + validate_certs: "{{ ssl.validate_certs }}" + status_code: 200, 404 + loop: "{{ xnat_container_service_images | default([]) }}"