This repository provides an example configuration for deploying an XNAT instance using Ansible through the UCL Medical Imaging Research Software Group (MIRSG) Ansible Collection. It includes sample inventory files, group variables, and playbooks to help you get started with automating the installation and configuration of XNAT.
- Ansible installed on your control machine.
- Access to target servers where XNAT will be deployed.
- Basic knowledge of Ansible and YAML syntax.
- Clone this repository to your control machine machine.
- Review and customize the inventory files located at
hosts.yml. - Modify the group variable files in the
group_vars/directory to suit your environment- Update database settings, storage paths, and SSL configurations as needed. Refer to https://github.com/UCL-MIRSG/ansible-collection-infra/tree/main/roles for additional role configurations and defaults
- Ensure any sensitive information is handled securely using Ansible Vault. These are referred to in the vars with the prefix
vault_.- Create vault.yml file to store sensitive variables in appropriate group_vars directories
- Check that the hosts are reachable and properly configured for Ansible by running:
ansible -i hosts.yml all -m ping
- Install the required Ansible collections by running:
ansible-galaxy collection install -r requirements.yml
- Run the playbook to deploy XNAT - ensure to replace
usernamewith your actual SSH username andexample_instancewith the appropriate group name from your inventory:ansible-playbook -i hosts.yml mirsg.infrastructure.install_xnat -u username --ask-become-pass -l example_instance --vault-password-file .vault_password
The variables in each vars.yml file under group_vars/ are organized to define settings specific to the group folder that they reside in.
For example, variables defined in group_vars/example_instance/vars.yml will apply only to hosts in the example_instance group as defined in the inventory file.
Variables in xnat and db group folders can be shared across multiple application instances, allowing for consistent configuration of XNAT application servers and database servers respectively.
The all group folder contains global variables that apply to all hosts in the inventory, providing a common configuration baseline.