diff --git a/roles/xnat/tasks/settings_files.yml b/roles/xnat/tasks/settings_files.yml index d538ced3..b832ec16 100644 --- a/roles/xnat/tasks/settings_files.yml +++ b/roles/xnat/tasks/settings_files.yml @@ -9,6 +9,15 @@ force: true notify: Restart tomcat +- name: "Validate xnat_config.site_name: {{ xnat_config.site_name }}" + ansible.builtin.assert: + that: + - xnat_config.site_name is match('^[A-Za-z][A-Za-z0-9_]*$') + fail_msg: > + xnat_config.site_name must start with a letter and contain only + letters, numbers, and underscores + success_msg: xnat_config.site_name is valid + - name: "Configure prefs-init" ansible.builtin.template: src: "prefs-init.j2"