-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds support for a container service to serve multiple XNAT clients. The main change is modifying the provision role to allow checking of multiple mount points. Previously only a single mount point was supported, but a container server may have a separate mount for each server it supports. Multiple mount points can be configured by defining the list `external_storage_mounts` in the host variables for the container server. If not set, the default will fall back to a list containing the single entry `external_storage_drive`, or an empty list if this is not set. This preserves existing behaviour. The container service client role will now configure the XNAT container service "Docker image hosts" (aka hubs) from which containers can be pulled to run on XNAT. These can be defined in the Ansible variables. In addition, I've added two optional changes to facilitate local testing: - Allow optional use of the GitHub package registry instead of JFrog, by permitting maven_artifact to optionally use username/password authentication instead of an authentication header. This preserves existing behaviour but permits switching to a package registry with a different authentication mechanism if appropriately configured in the ansible variables - Install firewalld package as part of the firewall role if it is not present
- Loading branch information
Showing
8 changed files
with
59 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
roles/xnat_container_service/tasks/add_container_service_hub.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
- name: Check if Image Host already configured | ||
ansible.builtin.uri: | ||
url: | ||
"{{ web_server.url }}/xapi/docker/hubs/{{ container_registry.name | | ||
urlencode }}" | ||
user: "{{ xnat_service_admin.username }}" | ||
password: "{{ xnat_service_admin.password }}" | ||
method: GET | ||
validate_certs: "{{ ssl.validate_certs }}" | ||
status_code: 200, 404 | ||
register: hub_check | ||
|
||
- name: Configure Image Host | ||
ansible.builtin.uri: | ||
url: "{{ web_server.url }}/xapi/docker/hubs" | ||
user: "{{ xnat_service_admin.username }}" | ||
password: "{{ xnat_service_admin.password }}" | ||
method: POST | ||
body_format: json | ||
body: | ||
name: "{{ container_registry.name }}" | ||
url: "{{ container_registry.url }}" | ||
username: "{{ container_registry.username }}" | ||
password: "{{ container_registry.password }}" | ||
default: "{{ container_registry.default }}" | ||
validate_certs: "{{ ssl.validate_certs }}" | ||
status_code: 200, 201 | ||
when: hub_check.status != 200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters