diff --git a/README.md b/README.md index f48c680..6ed1de8 100644 --- a/README.md +++ b/README.md @@ -95,6 +95,21 @@ To destroy the infrastructure, go to the `xnat-aws/provision` directory and type terraform destroy ``` +If this command is interrupted i.e. you lose internet connection when running locally, you may find that you can no longer run `terraform destroy` successfully. +Therefore you need to manually delete some resources in the AWS console, but you can encounter errors when attempting to delete certain resources: +`The vpc 'vpc-id' has dependencies and cannot be deleted.` or +`Network interface is currently in use and is of type "interface".` + +To find the remaining VPC dependencies, go to the `xnat-aws/provision` directory and type: + +```bash + ./show_resources_to_delete.sh +``` + +N.B. You need to add your `VPC ID` and `region` to the `show_resources_to_delete.sh` script. + +After deleting the dependiences you can retry deleting your VPC and/or Network interface - [see more info](https://repost.aws/knowledge-center/troubleshoot-dependency-error-delete-vpc). + ## AWS cost estimate [It is estimated](provision/aws-cost-estimate.pdf) the AWS resources will cost approximately **$270 diff --git a/configure/.gitignore b/configure/.gitignore index a46f5a3..2ef38cc 100644 --- a/configure/.gitignore +++ b/configure/.gitignore @@ -9,5 +9,5 @@ hosts.yml .vault_password group_vars/all/vault -group_vars/web/vault +group_vars/xnat/vault diff --git a/configure/README.md b/configure/README.md index 0c717c8..aa27ebe 100644 --- a/configure/README.md +++ b/configure/README.md @@ -15,7 +15,7 @@ This will install the dependencies listed in [requirements.txt](requirements.txt To run the configuration with Ansible we will need to: - install required Ansible roles and collection -- run the `install_container_service.yml` and `install_xnat.yml` playbooks +- run the `install_xnat.yml` playbooks These steps are done in the script `xnat-aws/configure/install_xnat.sh`. To run the script, go to the `xnat-aws/configure` directory and run the following command: diff --git a/configure/group_vars/all/vars b/configure/group_vars/all/vars new file mode 100644 index 0000000..fcbe17e --- /dev/null +++ b/configure/group_vars/all/vars @@ -0,0 +1,100 @@ +--- +xnat_data_dir: /data +xnat_root_dir: "{{ xnat_data_dir }}/xnat" +xnat_home_dir: "{{ xnat_root_dir }}/home" + +xnat_common_config: + admin_email: xnatadmin@{{ hostvars['xnat_web']['ansible_host'] }} + restrictUserListAccessToAdmins: true + uiAllowNonAdminProjectCreation: false + allowNonAdminsToClaimUnassignedSessions: true + reloadPrearcDatabaseOnStartup: true + par: false + primaryAdminUsername: "{{ xnat_service_admin.username }}" + receivedFileUser: "{{ xnat_service_admin.username }}" + ipsThatCanSendEmailsThroughRest: 127.0.0.1 + sessionXmlRebuilderInterval: "5" + # "^.*$" for all IPs + enabledProviders: + - localdb + enableSitewideAnonymizationScript: true + sitewideAnonymizationScript: + //\nversion \"6.1\"\nproject != \"Unassigned\" ? (0008,1030) := + project\n(0010,0010) := subject\n(0010,0020) := session + +xnat_service_admin: + username: "admin_user" + firstname: "admin" + lastname: "user" + password: "{{ vault_service_admin_password }}" + +package_registry: + enabled: false + url: "" + authentication_header: + Bearer {{ vault_package_registry_token | default(omit) }} + +# Set this to true if selinux is enabled on the hosting OS +selinux_enabled: true + +# XNAT supports PostgreSQL 11-14 +postgresql_version: 14 +postgresql_use_ssl: false + +java_keystore: + keystore_pass: "{{ vault_keystore_password }}" + +# JSON representation of the site-wide anonymisation script: this could be +# defined in a string, or extracted from a template file e.g. using +# lookup('template, 'foo.j2') | to_json +xnat_sitewide_anonymization_script: + "{{ xnat_common_config.sitewideAnonymizationScript | to_json }}" + +# web server VM +web_server: + host: "{{ hostvars['xnat_web']['ansible_host'] }}" + url: "http://{{ hostvars['xnat_web']['ansible_host'] }}" + ip: "{{ hostvars['xnat_web']['private_ip'] }}" + storage_dir: "{{ external_storage_drive }}/data" + +# database server VM +db_server: + host: "{{ hostvars['xnat_web']['database_hostname'] }}" + port: "{{ hostvars['xnat_web']['database_port'] }}" + postgresql_database: "{{ hostvars['xnat_web']['database_name'] }}" + postgresql_user: "{{ hostvars['xnat_web']['database_user'] }}" + postgresql_password: "{{ vault_postgres_xnat_password }}" + +# SSL certificate settings +ssl: + use_ssl: false + server_cert: "/etc/ssl/certs/{{ hostvars['xnat_web']['ansible_host'] }}.cert" + server_key: "/etc/ssl/certs/{{ hostvars['xnat_web']['ansible_host'] }}.key" + validate_certs: false + + +# XNAT configuration +xnat_config: + site_name: MIRSG_XNAT + site_description:
A test instance of XNAT. + admin_password: "{{ vault_admin_password }}" + +# mirsg.infrastructure.install_python +install_python: + version: "3" + pip_version: 21.3.1 + pip_executable: /usr/bin/pip3 + system_packages: + - python3 + - python3-pip + - python3-setuptools + pip_packages: + - cryptography + +# Mount point for external storage +external_storage_drive: "/storage" +mount_efs_src: "{{ hostvars[inventory_hostname]['efs_hostname'] }}:/" +mount_efs_directory: "{{ external_storage_drive }}" +mount_efs_fstype: "nfs4" +mount_efs_opts: "nfsvers=4.1,rsize=1048576,hard,timeo=600,retrans=2,noresvport" +mount_efs_state: mounted diff --git a/configure/group_vars/all/vars/docker.yml b/configure/group_vars/all/vars/docker.yml deleted file mode 100644 index 6e194a0..0000000 --- a/configure/group_vars/all/vars/docker.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -docker_client: - owner: "{{ tomcat.owner }}" - group: "{{ tomcat.owner }}" - cert_dir: "/usr/share/tomcat/.docker" - ssl_key_file: "/usr/share/tomcat/.docker/key.pem" - ssl_csr_file: "/usr/share/tomcat/.docker/docker.csr" - ssl_pk8_file: "/usr/share/tomcat/.docker/docker.pk8" - ssl_cert_file: "/usr/share/tomcat/.docker/cert.pem" - server_ca_cert_file: "/usr/share/tomcat/.docker/ca.pem" diff --git a/configure/group_vars/all/vars/general.yml b/configure/group_vars/all/vars/general.yml deleted file mode 100644 index 48b0226..0000000 --- a/configure/group_vars/all/vars/general.yml +++ /dev/null @@ -1,35 +0,0 @@ ---- -package_registry: - enabled: false - url: "" - authentication_header: {} - -# Directory on the control node where the Ansible scripts can store files that -# need to be temporarily cached, such as certificate files that are copied -# between hosts. -# You can persist these files between runs to speed up future deployments. -# In a CI setup, it is best to choose a location that is not within the -# repository clone, as the files that are created could interfere with the CI's -# automated checkout and update processes -ansible_cache_dir: "{{ lookup('env', 'HOME') }}/ansible_persistent_files" - -# Locale for the servers -server_locale: "en_GB.UTF-8" - -# Set this to true if selinux is enabled on the hosting OS -selinux_enabled: true - -# Mount point for external storage -EXTERNAL_STORAGE_DRIVE: "/storage" - -# Infrastructure -monitoring_service_enabled: false -container_service_enabled: true -container_service_remote_xnat_root: "/storage/data/xnat" - -efs_mount: - src: "{{ hostvars[inventory_hostname]['efs_hostname'] }}:/" - directory: "{{ EXTERNAL_STORAGE_DRIVE }}" - fstype: "nfs4" - opts: "nfsvers=4.1,rsize=1048576,hard,timeo=600,retrans=2,noresvport" - state: mounted diff --git a/configure/group_vars/all/vars/python.yml b/configure/group_vars/all/vars/python.yml deleted file mode 100644 index e87db9c..0000000 --- a/configure/group_vars/all/vars/python.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- -install_python: - version: "3" - pip_version: "21.3.1" - pip_executable: "pip3" - system_packages: - - python3 - - python3-pip - - python3-setuptools - pip_packages: - - cryptography diff --git a/configure/group_vars/all/vars/xnat.yml b/configure/group_vars/all/vars/xnat.yml deleted file mode 100644 index 798ff9c..0000000 --- a/configure/group_vars/all/vars/xnat.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -# web server VM -xnat_web_server: - host: "{{ hostvars['xnat_web']['ansible_host'] }}" - url: "http://{{ hostvars['xnat_web']['ansible_host'] }}" - ip: "{{ hostvars['xnat_web']['private_ip'] }}" - storage_dir: "{{ EXTERNAL_STORAGE_DRIVE }}/data" - -# database server VM -xnat_db: - host: "{{ hostvars['xnat_web']['database_hostname'] }}" - port: "{{ hostvars['xnat_web']['database_port'] }}" - postgres_xnat_database: "{{ hostvars['xnat_web']['database_name'] }}" - postgres_xnat_user: "{{ hostvars['xnat_web']['database_user'] }}" - postgres_xnat_password: "{{ vault_postgres_xnat_password }}" diff --git a/configure/group_vars/container_service.yml b/configure/group_vars/container_service.yml new file mode 100644 index 0000000..7042230 --- /dev/null +++ b/configure/group_vars/container_service.yml @@ -0,0 +1,8 @@ +--- +# mirsg.infrastructure.docker - only used by the container_service_host group +# but the container_service_client group needs access to these variables +docker_client_certificate_cache_directory: + "{{ ansible_cache_dir }}/cserv_certificates/cserv" +docker_server_hostname: "{{ hostvars['xnat_cserv']['ansible_host'] }}" +docker_server_ip: "{{ hostvars['xnat_cserv']['private_ip'] }}" +docker_server_port: 2376 diff --git a/configure/group_vars/container_service_client.yml b/configure/group_vars/container_service_client.yml new file mode 100644 index 0000000..abede34 --- /dev/null +++ b/configure/group_vars/container_service_client.yml @@ -0,0 +1,15 @@ +--- +# mirsg.xnat_container_service +xnat_container_service_name: Container Service +xnat_container_service_url: "{{ web_server.url }}/xapi/docker/server" +xnat_container_service_client_hostname: "{{ hostvars['xnat_web']['ansible_host'] }}" +xnat_container_service_validate_certs: "{{ ssl.validate_certs }}" + +xnat_container_service_hostname: "{{ docker_server_hostname }}" +xnat_container_service_ip: "{{ docker_service_ip }}" +xnat_container_service_port: "{{ docker_server_port }}" +xnat_container_service_certificate_cache_directory: + "{{ docker_client_certificate_cache_directory }}" + +xnat_container_service_path_translation_xnat_prefix: "{{ xnat_root_dir }}" +xnat_container_service_path_translation_docker_prefix: /storage/data/xnat diff --git a/configure/group_vars/container_service_host.yml b/configure/group_vars/container_service_host.yml new file mode 100644 index 0000000..2cf110d --- /dev/null +++ b/configure/group_vars/container_service_host.yml @@ -0,0 +1,10 @@ +--- +# mirsg.infrastructure.docker +docker_generate_certificates: true # generate TLS certs for clients +docker_client_hostnames: + - "{{ hostvars['xnat_web']['ansible_host'] }}" +docker_tls_verify: false + +# docker<25 is required for XNAT +# see: https://groups.google.com/g/xnat_discussion/c/yyPBkN4kayE/m/LUe5GQH5AAAJ +docker_version: 24.0.9 diff --git a/configure/group_vars/cserv_hosts/vars/docker.yml b/configure/group_vars/cserv_hosts/vars/docker.yml deleted file mode 100644 index 79bc034..0000000 --- a/configure/group_vars/cserv_hosts/vars/docker.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -docker: - owner: "root" - group: "root" - cert_dir: "/home/docker/.docker" - client_cert_dir: "/home/docker/.docker/client_certs" - ca_key: "/home/docker/.docker/ca.key" - ca_csr: "/home/docker/.docker/ca.csr" - ca_cert: "/home/docker/.docker/ca.pem" - server_key: "/home/docker/.docker/server-key.pem" - server_csr: "/home/docker/.docker/server.csr" - server_cert: "/home/docker/.docker/server-cert.pem" - config_dir: "/etc/docker" - daemon_conf_file: "/etc/docker/daemon.json" - service_file_dir: "/etc/systemd/system/docker.service.d" - service_name: "docker" - repo_url: "https://download.docker.com/linux/centos/docker-ce.repo" - yum_package: "docker" diff --git a/configure/group_vars/web/vars/java.yml b/configure/group_vars/web/vars/java.yml deleted file mode 100644 index 60ea99c..0000000 --- a/configure/group_vars/web/vars/java.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -java: - profile_d: "/etc/profile.d" - home: "/usr/lib/jvm/jre" - package: "java-1.8.0-openjdk-devel" - keystore_path: "/usr/lib/jvm/jre/lib/security/cacerts/" diff --git a/configure/group_vars/web/vars/nginx.yml b/configure/group_vars/web/vars/nginx.yml deleted file mode 100644 index 28fe241..0000000 --- a/configure/group_vars/web/vars/nginx.yml +++ /dev/null @@ -1,25 +0,0 @@ ---- -nginx: - owner: root - group: root - log_folder: "/var/log/nginx" - http_port: 80 - https_port: 443 - certs_dir: "/etc/nginx/ssl" - dh_params_file: "/etc/nginx/ssl/dhparam.pem" - conf_file: "/etc/nginx/nginx.conf" - ssl_cert_file: "/etc/nginx/ssl/server.cert" - ssl_key_file: "/etc/nginx/ssl/server.key" - -# Support for ipv6 -ipv6_enabled: false - -# Bit size for OpenSSL Diffie-Hellman Parameters. Higher bit sizes are more -# secure, but require exponentially larger times for the one-off parameter -# generation. Use 4096 for production. These may take 10mins+ to generate but -# are only generated once per server. -# For local testing (non-production), use 2096 to speed up deployment. -diffie_helman_size_bits: 2048 - -dicom_port: 8104 -xnat_dicom_port: 8105 diff --git a/configure/group_vars/web/vars/postgresql.yml b/configure/group_vars/web/vars/postgresql.yml deleted file mode 100644 index f050d95..0000000 --- a/configure/group_vars/web/vars/postgresql.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -# XNAT supports PostgreSQL 10 - 14 -# See: https://groups.google.com/g/xnat_discussion/c/INKizGBktEQ/m/jauYgo8oAAAJ -postgresql_version: "14" - -# For installing postgres -postgresql_rpm_gpg_key_pgdg: "https://www.postgresql.org/download/keys/RPM-GPG-KEY-PGDG" - -# mirsg.postgresql - download and install - we need to do this on both the web server and the db -postgresql_install: - disable_gpg_check: false - rpm: "https://download.postgresql.org/pub/repos/yum/reporpms/EL-{{ ansible_facts['distribution_major_version'] }}-x86_64/pgdg-redhat-repo-latest.noarch.rpm" - yum_package: "postgresql{{ postgresql_version }}-server" - yum_contrib_package: "postgresql{{ postgresql_version }}-contrib" diff --git a/configure/group_vars/web/vars/ssl.yml b/configure/group_vars/web/vars/ssl.yml deleted file mode 100644 index 5328770..0000000 --- a/configure/group_vars/web/vars/ssl.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -# SSL certificate settings -ssl: - use_ssl: false - server_cert: "/etc/ssl/certs/{{ hostvars['xnat_web']['ansible_host'] }}.cert" - server_key: "/etc/ssl/certs/{{ hostvars['xnat_web']['ansible_host'] }}.key" - validate_certs: no diff --git a/configure/group_vars/web/vars/tomcat.yml b/configure/group_vars/web/vars/tomcat.yml deleted file mode 100644 index 06e0791..0000000 --- a/configure/group_vars/web/vars/tomcat.yml +++ /dev/null @@ -1,29 +0,0 @@ ---- -tomcat_version: 9.0.76 - -tomcat_webapp_name: "ROOT" - -tomcat: - catalina_home: "/usr/share/tomcat" - config_file: "/usr/share/tomcat/conf/tomcat.conf" - server_config_file: "/usr/share/tomcat/conf/server.xml" - service_config_file: "/etc/systemd/system/tomcat.service" - owner: "tomcat" - group: "tomcat" - hostname: localhost - server_port: 8005 - catalina_port: 8983 - catalina_redirect_port: 8443 - shutdown_port: 8005 - port: 8080 - root: "/usr/share/tomcat/webapps/{{ tomcat_webapp_name }}" - root_webapp: "/usr/share/tomcat/webapps/{{ tomcat_webapp_name }}.war" - binary_url: "https://archive.apache.org/dist/tomcat/tomcat-\ - {{ tomcat_version.split('.')[0] }}/v{{ tomcat_version }}/bin/\ - apache-tomcat-{{ tomcat_version }}.tar.gz" - -# You may want to increase the heap space if you have enough RAM available -java_mem: - Xms: "512M" - Xmx: "16G" - MetaspaceSize: "300M" diff --git a/configure/group_vars/web/vars/xnat.yml b/configure/group_vars/web/vars/xnat.yml deleted file mode 100644 index 7241419..0000000 --- a/configure/group_vars/web/vars/xnat.yml +++ /dev/null @@ -1,108 +0,0 @@ ---- -xnat_data_dir: "/data" -xnat_root_dir: "{{ xnat_data_dir }}/xnat" -xnat_home_dir: "{{ xnat_root_dir }}/home" - -xnat: - owner: "{{ tomcat.owner }}" - group: "{{ tomcat.group }}" - install_downloads: "{{ tomcat.catalina_home }}/install_downloads" - pipeline_install_dir: "{{ tomcat.catalina_home }}/pipeline_installer" - processingUrl: "" - -xnat_version: 1.8.7.1 -xnat_pipeline_version: 1.8.3 - -xnat_source: - war_file_name: "xnat-web-{{ xnat_version }}.war" - plugins_downloads_dir: "/ansible/downloads/xnat_plugins" - xnat_downloads_dir: "/ansible/downloads/xnat" - pipeline_installer_file_name: "pipeline-installer-{{ xnat_pipeline_version }}.tar" - xnat_war_url: "https://api.bitbucket.org/2.0/repositories/xnatdev/xnat-web/downloads/xnat-web-{{ xnat_version }}.war" - pipelines_url: "https://api.github.com/repos/NrgXnat/xnat-pipeline-engine/tarball/{{ xnat_pipeline_version }}" - context_file_location: "/usr/share/tomcat/webapps/ROOT/META-INF/context.xml" - -xnat_plugin_urls: - - "https://api.bitbucket.org/2.0/repositories/xnatdev/xsync/downloads/xsync-plugin-all-1.5.0.jar" - #- "https://api.bitbucket.org/2.0/repositories/xnatx/ldap-auth-plugin/downloads/ldap-auth-plugin-1.1.0.jar" - - "https://api.bitbucket.org/2.0/repositories/xnatdev/container-service/downloads/container-service-3.3.0-fat.jar" - - "https://api.bitbucket.org/2.0/repositories/xnatx/xnatx-batch-launch-plugin/downloads/batch-launch-0.6.0.jar" - - "https://github.com/VUIIS/dax/raw/main/misc/xnat-plugins/dax-plugin-genProcData-1.4.2.jar" - - "https://api.bitbucket.org/2.0/repositories/icrimaginginformatics/ohif-viewer-xnat-plugin/downloads/ohif-viewer-3.4.1.jar" - - "https://api.bitbucket.org/2.0/repositories/xnatx/ml-plugin/downloads/ml-plugin-1.0.2.jar" - - "https://api.bitbucket.org/2.0/repositories/xnatx/datasets-plugin/downloads/datasets-plugin-1.0.2.jar" - - "https://api.bitbucket.org/2.0/repositories/xnatdev/xnat-image-viewer-plugin/downloads/ximgview-plugin-1.0.2.jar" - - "https://api.bitbucket.org/2.0/repositories/xnatx/xnatx-dxm-settings-plugin/downloads/dxm-settings-plugin-1.0.jar" - -xnat_plugin_bundle_urls: [] -xnat_plugin_packages: [] -xnat_server_specific_plugin_urls: [] -xnat_server_specific_plugin_packages: [] - -pipeline_engine_enabled: true - -java_keystore: - keystore_pass: "{{ vault_keystore_password }}" - -# JSON representation of the site-wide anonymisation script: this could be -# defined in a string, or extracted from a template file e.g. using -# lookup('template, 'foo.j2') | to_json -xnat_sitewide_anonymization_script: "{{ xnat_common_config.sitewideAnonymizationScript | to_json }}" - -# Path to server logo file -xnat_config_logo: "/images/logo.png" - -xnat_service_admin: - username: "admin_user" - firstname: "admin" - lastname: "user" - password: "{{ vault_service_admin_password }}" - -# XNAT configuration shared between all servers -xnat_common_config: - admin_email: "xnatadmin@{{ hostvars['xnat_web']['ansible_host'] }}" - restrictUserListAccessToAdmins: true - uiAllowNonAdminProjectCreation: false - allowNonAdminsToClaimUnassignedSessions: true - reloadPrearcDatabaseOnStartup: true - par: false - primaryAdminUsername: "{{ xnat_service_admin.username }}" - receivedFileUser: "{{ xnat_service_admin.username }}" - ipsThatCanSendEmailsThroughRest: "127.0.0.1" - sessionXmlRebuilderInterval: "5" - # "^.*$" for all IPs - enabledProviders: ["localdb"] - enableSitewideAnonymizationScript: true - sitewideAnonymizationScript: "//\nversion \"6.1\"\nproject != \"Unassigned\" ? (0008,1030) := project\n(0010,0010) := subject\n(0010,0020) := session" - -# XNAT configuration -xnat_config: - site_name: "XNAT" - site_description: "
An instance of XNAT deployed on AWS."
- admin_password: "{{ vault_admin_password }}"
-
-# LDAP configuration
-ldap:
- enabled: false
- name: ""
- address: ""
- userdn: ""
- password: "{{ vault_ldap_password }}"
- base: ""
- filter: ""
- ca_cert: ""
- keystore_alias: ""
-
-ldap_ca_cert_file_on_client: "{{ xnat.install_downloads }}/certs/ldap-ca.cert"
-
-# Mail server settings
-smtp:
- enabled: "false"
- hostname: "192.168.56.101"
- port: "2525"
- protocol: "smtp"
- auth: ""
- username: ""
- password: "{{ vault_smtp_password }}"
- start_tls: "false"
- ssl_trust: "*"
diff --git a/configure/group_vars/web/vars/xnat_project.yml b/configure/group_vars/web/vars/xnat_project.yml
deleted file mode 100644
index 606d1ea..0000000
--- a/configure/group_vars/web/vars/xnat_project.yml
+++ /dev/null
@@ -1,25 +0,0 @@
----
-# Variables for creating an XNAT project
-xnat_project:
- id: ibash
- metadata_file: 'ibash_project.xml'
-
-xnat_investigator:
- title: "Prof"
- firstname: "Charles"
- lastname: "Xavier"
- institution: "Xavier Institute For Higher Learning"
-
-xnat_project_owner:
- username: "profX"
- password: "carlos1602"
- firstName: "Charles"
- lastName: "Xavier"
- email: "c.xavier@{{ hostvars['xnat_web']['ansible_host'] }}"
-
-xnat_download_dir: "ideas-workshop-datasets"
-xnat_project_data:
- url: "https://ideas-workshop-datasets.s3.amazonaws.com/xnat-ibash.zip"
- zip_file: "{{ xnat_download_dir }}/ibash.zip"
- unzip_target: "{{ xnat_download_dir }}/ibash"
- sessions_metadata: "{{ xnat_download_dir }}/ibash/ibash-sessions.csv"
diff --git a/configure/group_vars/xnat/vars b/configure/group_vars/xnat/vars
new file mode 100644
index 0000000..99b7478
--- /dev/null
+++ b/configure/group_vars/xnat/vars
@@ -0,0 +1,44 @@
+# mirsg.xnat.xnat
+# Some times the default admin account hasn't finished creating even after tomcat has started
+# Add a delay here to give the admin account a chance to be created
+# Note, this issue only seems to happen in CI
+xnat_wait_for_tomcat: 15
+
+# You may want to increase the heap space if you have enough RAM available
+java_mem:
+ Xms: "512M"
+ Xmx: "6G"
+ MetaspaceSize: "300M"
+
+xnat_plugin_urls:
+ - https://api.bitbucket.org/2.0/repositories/xnatdev/container-service/downloads/container-service-3.4.3-fat.jar
+ - https://api.bitbucket.org/2.0/repositories/icrimaginginformatics/ohif-viewer-xnat-plugin/downloads/ohif-viewer-3.6.2.jar
+ - https://api.bitbucket.org/2.0/repositories/xnatx/ml-plugin/downloads/ml-plugin-1.0.2.jar
+ - https://api.bitbucket.org/2.0/repositories/xnatx/datasets-plugin/downloads/datasets-plugin-1.0.3.jar
+ - https://api.bitbucket.org/2.0/repositories/xnatdev/xnat-image-viewer-plugin/downloads/ximgview-plugin-1.0.2.jar
+ - https://api.bitbucket.org/2.0/repositories/xnatx/xnatx-dxm-settings-plugin/downloads/dxm-settings-plugin-1.0.jar
+
+# Variables for creating an XNAT project
+xnat_project:
+ id: ibash
+ metadata_file: 'ibash_project.xml'
+
+xnat_investigator:
+ title: "Prof"
+ firstname: "Charles"
+ lastname: "Xavier"
+ institution: "Xavier Institute For Higher Learning"
+
+xnat_project_owner:
+ username: "profX"
+ password: "carlos1602"
+ firstName: "Charles"
+ lastName: "Xavier"
+ email: "c.xavier@{{ hostvars['xnat_web']['ansible_host'] }}"
+
+xnat_download_dir: "ideas-workshop-datasets"
+xnat_project_data:
+ url: "https://ideas-workshop-datasets.s3.amazonaws.com/xnat-ibash.zip"
+ zip_file: "{{ xnat_download_dir }}/ibash.zip"
+ unzip_target: "{{ xnat_download_dir }}/ibash"
+ sessions_metadata: "{{ xnat_download_dir }}/ibash/ibash-sessions.csv"
diff --git a/configure/group_vars/xnat_container_service/vars/container_service.yml b/configure/group_vars/xnat_container_service/vars/container_service.yml
deleted file mode 100644
index 24bfd21..0000000
--- a/configure/group_vars/xnat_container_service/vars/container_service.yml
+++ /dev/null
@@ -1,13 +0,0 @@
----
-# Variables for the Container Service hosts and the clients (web servers) it serves
-xnat_container_service:
- name: "Container Service"
- host: "{{ hostvars['xnat_cserv']['ansible_host'] }}"
- ip: "{{ hostvars['xnat_cserv']['private_ip'] }}"
- port: "2376"
- clients:
- - "{{ hostvars['xnat_web']['ansible_host'] }}"
- client_ips:
- - "{{ hostvars['xnat_web']['ansible_ip'] }}"
-
-xnat_container_service_temp_files_cert_dir: "{{ ansible_cache_dir }}/cserv_certificates/cserv"
diff --git a/configure/install_xnat.sh b/configure/install_xnat.sh
index 8c9b340..167165f 100755
--- a/configure/install_xnat.sh
+++ b/configure/install_xnat.sh
@@ -4,8 +4,5 @@ set -e
echo "Install the required Ansible dependencies"
ansible-galaxy install -r playbooks/roles/requirements.yml --force
-echo "Install the XNAT Container service"
-ansible-playbook playbooks/install_container_service.yml -i hosts.yml --vault-password-file=.vault_password
-
echo "Install and configure XNAT"
ansible-playbook playbooks/install_xnat.yml -i hosts.yml --vault-password-file=.vault_password
diff --git a/configure/playbooks/group_vars/all.yml b/configure/playbooks/group_vars/all.yml
new file mode 100644
index 0000000..d917b2f
--- /dev/null
+++ b/configure/playbooks/group_vars/all.yml
@@ -0,0 +1,13 @@
+---
+ansible_cache_dir: "{{ lookup('env', 'HOME') }}/ansible_persistent_files"
+
+# mirsg.infrastructure.postgresql - download and install - we need to do this on both the web server and the db
+postgresql_install:
+ disable_gpg_check: false
+ rpm: >-
+ https://download.postgresql.org/pub/repos/yum/reporpms/EL-{{
+ ansible_facts['distribution_major_version'] }}-{{
+ ansible_facts['architecture'] }}/pgdg-redhat-repo-latest.noarch.rpm
+ yum_package: postgresql{{ postgresql_version }}-server
+ yum_contrib_package: postgresql{{ postgresql_version }}-contrib # required only on CentOS 7
+ yum_client_package: postgresql{{ postgresql_version }}
diff --git a/configure/playbooks/group_vars/xnat.yml b/configure/playbooks/group_vars/xnat.yml
new file mode 100644
index 0000000..e3bb105
--- /dev/null
+++ b/configure/playbooks/group_vars/xnat.yml
@@ -0,0 +1,62 @@
+---
+xnat:
+ owner: "{{ tomcat_owner }}"
+ group: "{{ tomcat_group }}"
+ install_downloads: "{{ tomcat_catalina_home }}/install_downloads"
+ pipeline_install_dir: "{{ tomcat_catalina_home }}/pipeline_installer"
+ processingUrl: ""
+
+xnat_source:
+ war_file_name: xnat-web-{{ xnat_version }}.war
+ plugins_downloads_dir: /ansible/downloads/xnat_plugins
+ xnat_downloads_dir: /ansible/downloads/xnat
+ pipeline_installer_file_name:
+ pipeline-installer-{{ xnat_pipeline_version }}.tar
+ xnat_war_url:
+ https://api.bitbucket.org/2.0/repositories/xnatdev/xnat-web/downloads/xnat-web-{{
+ xnat_version }}.war
+ pipelines_url:
+ https://api.github.com/repos/NrgXnat/xnat-pipeline-engine/tarball/{{
+ xnat_pipeline_version }}
+ context_file_location: /usr/share/tomcat/webapps/ROOT/META-INF/context.xml
+
+# mirsg.infrastructure.tomcat
+tomcat_version: 9.0.82
+tomcat_owner: tomcat
+tomcat_group: tomcat
+
+tomcat_webapp_name: ROOT
+tomcat_root: /usr/share/tomcat/webapps/{{ tomcat_webapp_name }}
+tomcat_root_webapp: "{{ tomcat_root }}.war"
+
+tomcat_catalina_home: /usr/share/tomcat
+tomcat_catalina_opts: >-
+ -Dxnat.home={{ xnat_home_dir }} -Xms{{ java_mem.Xms | default("512M") }}
+ -Xmx{{ java_mem.Xmx | default("1G") }} -XX:MetaspaceSize={{
+ java_mem.MetaspaceSize | default("100M") }} -XX:+UseG1GC -server
+
+tomcat_hostname: localhost
+tomcat_port: 8080
+
+tomcat_backup_directory: /usr/share/tomcat_bkp
+tomcat_items_to_restore:
+ - "{{ tomcat_backup_directory }}/webapps"
+ - "{{ tomcat_backup_directory }}/logs"
+ - "{{ tomcat_backup_directory }}/install_downloads"
+ - "{{ tomcat_backup_directory }}/.postgresql"
+
+java:
+ keystore_path: /usr/lib/jvm/jre/lib/security/cacerts/
+
+ldap_ca_cert_file_on_client: "{{ xnat.install_downloads }}/certs/ldap-ca.cert"
+
+# mirsg.infrastructure.nginx
+nginx_use_ssl: "{{ ssl.use_ssl }}"
+nginx_server_name: "{{ web_server.host }}"
+nginx_upstream_port: 104
+nginx_upstream_listen_port: 8104
+nginx_proxy_port: 8080 # tomcat
+nginx_root: /usr/share/tomcat/webapps/ROOT
+nginx_app_access_log: "{{ nginx_log_folder }}/xnat.access.log"
+nginx_app_error_log: "{{ nginx_log_folder }}/xnat.error.log"
+nginx_conf_template: nginx_reverse_proxy_aws.j2
diff --git a/configure/playbooks/install_container_service.yml b/configure/playbooks/install_container_service.yml
deleted file mode 100644
index 38b7204..0000000
--- a/configure/playbooks/install_container_service.yml
+++ /dev/null
@@ -1,25 +0,0 @@
----
-# Set up the Container Service on the hosts
-# The client configuration is done in `install_xnat.yml`
-- name: Wait until instance is running
- hosts: cserv_hosts
- gather_facts: false
-
- roles:
- - { role: wait_until_running }
-
-- name: Provision container service host
- hosts: cserv_hosts
- become: true
- become_user: root
- become_method: sudo
- gather_facts: true
-
- roles:
- - { role: provision }
- - { role: mirsg.install_python }
- - { role: docker }
- - {
- role: sign_docker_client_cert,
- clients: "{{ xnat_container_service.clients }}",
- }
diff --git a/configure/playbooks/install_xnat.yml b/configure/playbooks/install_xnat.yml
index 6dc3fa3..0e27d41 100644
--- a/configure/playbooks/install_xnat.yml
+++ b/configure/playbooks/install_xnat.yml
@@ -1,32 +1,36 @@
---
-- name: Wait until instance is running
- hosts: web
- gather_facts: false
+- name: Install and configure XNAT
+ hosts: xnat
+ become: true
+ gather_facts: true
roles:
- - { role: wait_until_running }
+ - role: wait_until_running
+ - role: mount_efs
+ - role: mirsg.infrastructure.provision
+ - role: mirsg.infrastructure.install_python
+ - role: mirsg.infrastructure.install_java
+ - role: mirsg.infrastructure.tomcat
+ - role: mirsg.infrastructure.nginx
+ - role: mirsg.infrastructure.xnat
-- name: Install dependencies
- hosts: web
+- name: Setup Container Service on hosts
+ hosts: container_service_host
become: true
- become_user: root
- become_method: sudo
gather_facts: true
roles:
- - { role: provision }
- - { role: mirsg.install_python }
- - { role: java }
- - { role: tomcat }
- - { role: nginx }
+ - role: wait_until_running
+ - role: mount_efs
+ - role: mirsg.infrastructure.provision
+ - role: mirsg.infrastructure.install_python
+ - role: mirsg.infrastructure.docker
-- name: Install and configure XNAT
- hosts: web
+- name: Setup Container Service on clients (i.e. the web servers)
+ hosts: container_service_client
become: true
- become_user: root
- become_method: sudo
gather_facts: true
roles:
- - { role: xnat }
- - { role: container_service_client, when: container_service_enabled }
+ - role: mirsg.infrastructure.xnat_container_service
+ - role: container_service_images
diff --git a/configure/playbooks/rerun_tomcat.yml b/configure/playbooks/rerun_tomcat.yml
deleted file mode 100644
index 319b668..0000000
--- a/configure/playbooks/rerun_tomcat.yml
+++ /dev/null
@@ -1,22 +0,0 @@
----
-- name: Stop and restart tomcat
- hosts: web
- become: true
- become_user: root
- become_method: sudo
- gather_facts: true
-
- pre_tasks:
- - name: stop tomcat
- ansible.builtin.service:
- name: tomcat
- state: stopped
-
- roles:
- - { role: tomcat }
-
- post_tasks:
- - name: restart tomcat
- ansible.builtin.service:
- name: tomcat
- state: restarted
diff --git a/configure/playbooks/roles/container_service_client/tasks/main.yml b/configure/playbooks/roles/container_service_client/tasks/main.yml
deleted file mode 100644
index a196aa9..0000000
--- a/configure/playbooks/roles/container_service_client/tasks/main.yml
+++ /dev/null
@@ -1,69 +0,0 @@
----
-- name: Ensure docker cert dir exists on client
- ansible.builtin.file:
- path: "{{ docker_client.cert_dir }}"
- state: directory
- owner: "{{ docker_client.owner }}"
- group: "{{ docker_client.group }}"
- mode: 0700
-
-- name: Copy docker server certificate to client
- ansible.builtin.copy:
- src: "{{ xnat_container_service_temp_files_cert_dir }}/ca.pem"
- dest: "{{ docker_client.server_ca_cert_file }}"
- owner: "{{ docker_client.owner }}"
- group: "{{ docker_client.group }}"
- mode: 0600
-
-- name: Copy signed docker client certificate to client
- ansible.builtin.copy:
- src: "{{ xnat_container_service_temp_files_cert_dir }}/{{ xnat_web_server.host }}.cert"
- dest: "{{ docker_client.ssl_cert_file }}"
- owner: "{{ docker_client.owner }}"
- group: "{{ docker_client.group }}"
- mode: 0600
-
-- name: Copy private key to client
- ansible.builtin.copy:
- src: "{{ xnat_container_service_temp_files_cert_dir }}/key.pem"
- dest: "{{ docker_client.ssl_key_file }}"
- owner: "{{ docker_client.owner }}"
- group: "{{ docker_client.group }}"
- mode: 0600
-
-- name: "Configure XNAT to talk to container service"
- ansible.builtin.uri:
- url: "{{ xnat_web_server.url }}/xapi/docker/server"
- user: "{{ xnat_service_admin.username }}"
- password: "{{ xnat_service_admin.password }}"
- method: POST
- body_format: json
- body:
- name: "{{ xnat_container_service.name }}"
- host: "https://{{ xnat_container_service.host }}:{{ xnat_container_service.port }}"
- cert-path: "{{ docker_client.cert_dir }}"
- swarm-mode: false
- path-translation-xnat-prefix: "{{ xnat_root_dir }}"
- path-translation-docker-prefix: "{{ container_service_remote_xnat_root }}"
- pull-images-on-xnat-init: false
- container-user: ""
- validate_certs: "{{ ssl.validate_certs }}"
- status_code: 200, 201
-
-# Return 201 if added, 400 if already exists
-- name: Add images to Container Service
- ansible.builtin.uri:
- url: "{{ xnat_web_server.url }}/xapi/commands"
- user: "{{ xnat_service_admin.username }}"
- password: "{{ xnat_service_admin.password }}"
- method: POST
- body: "{{ lookup('file', command_file) }}"
- body_format: json
- validate_certs: "{{ ssl.validate_certs }}"
- status_code: [201, 400]
- register: xnat_commands_added
- changed_when: xnat_commands_added.status == 201
- loop_control:
- loop_var: "command_file"
- with_fileglob:
- - "files/*-command.json"
diff --git a/configure/playbooks/roles/container_service_client/files/dcm2niix-command.json b/configure/playbooks/roles/container_service_images/files/dcm2niix-command.json
similarity index 100%
rename from configure/playbooks/roles/container_service_client/files/dcm2niix-command.json
rename to configure/playbooks/roles/container_service_images/files/dcm2niix-command.json
diff --git a/configure/playbooks/roles/container_service_client/files/defaced-mri-convert-command.json b/configure/playbooks/roles/container_service_images/files/defaced-mri-convert-command.json
similarity index 100%
rename from configure/playbooks/roles/container_service_client/files/defaced-mri-convert-command.json
rename to configure/playbooks/roles/container_service_images/files/defaced-mri-convert-command.json
diff --git a/configure/playbooks/roles/container_service_client/files/defaced-recon-all-command.json b/configure/playbooks/roles/container_service_images/files/defaced-recon-all-command.json
similarity index 100%
rename from configure/playbooks/roles/container_service_client/files/defaced-recon-all-command.json
rename to configure/playbooks/roles/container_service_images/files/defaced-recon-all-command.json
diff --git a/configure/playbooks/roles/container_service_client/files/defaced-recon-all-gpu-command.json b/configure/playbooks/roles/container_service_images/files/defaced-recon-all-gpu-command.json
similarity index 100%
rename from configure/playbooks/roles/container_service_client/files/defaced-recon-all-gpu-command.json
rename to configure/playbooks/roles/container_service_images/files/defaced-recon-all-gpu-command.json
diff --git a/configure/playbooks/roles/container_service_client/files/mri-convert-command.json b/configure/playbooks/roles/container_service_images/files/mri-convert-command.json
similarity index 100%
rename from configure/playbooks/roles/container_service_client/files/mri-convert-command.json
rename to configure/playbooks/roles/container_service_images/files/mri-convert-command.json
diff --git a/configure/playbooks/roles/container_service_client/files/pydeface-command.json b/configure/playbooks/roles/container_service_images/files/pydeface-command.json
similarity index 100%
rename from configure/playbooks/roles/container_service_client/files/pydeface-command.json
rename to configure/playbooks/roles/container_service_images/files/pydeface-command.json
diff --git a/configure/playbooks/roles/container_service_client/files/recon-all-command.json b/configure/playbooks/roles/container_service_images/files/recon-all-command.json
similarity index 100%
rename from configure/playbooks/roles/container_service_client/files/recon-all-command.json
rename to configure/playbooks/roles/container_service_images/files/recon-all-command.json
diff --git a/configure/playbooks/roles/container_service_client/files/recon-all-gpu-command.json b/configure/playbooks/roles/container_service_images/files/recon-all-gpu-command.json
similarity index 100%
rename from configure/playbooks/roles/container_service_client/files/recon-all-gpu-command.json
rename to configure/playbooks/roles/container_service_images/files/recon-all-gpu-command.json
diff --git a/configure/playbooks/roles/container_service_images/tasks/main.yml b/configure/playbooks/roles/container_service_images/tasks/main.yml
new file mode 100644
index 0000000..52ad20b
--- /dev/null
+++ b/configure/playbooks/roles/container_service_images/tasks/main.yml
@@ -0,0 +1,18 @@
+---
+# Return 201 if added, 400 if already exists
+- name: Add images to Container Service
+ ansible.builtin.uri:
+ url: "{{ web_server.url }}/xapi/commands"
+ user: "{{ xnat_service_admin.username }}"
+ password: "{{ xnat_service_admin.password }}"
+ method: POST
+ body: "{{ lookup('file', command_file) }}"
+ body_format: json
+ validate_certs: "{{ ssl.validate_certs }}"
+ status_code: [201, 400]
+ register: xnat_commands_added
+ changed_when: xnat_commands_added.status == 201
+ loop_control:
+ loop_var: "command_file"
+ with_fileglob:
+ - "files/*-command.json"
diff --git a/configure/playbooks/roles/docker/handlers/main.yml b/configure/playbooks/roles/docker/handlers/main.yml
deleted file mode 100644
index c91c97e..0000000
--- a/configure/playbooks/roles/docker/handlers/main.yml
+++ /dev/null
@@ -1,10 +0,0 @@
----
-- name: restart docker
- ansible.builtin.service:
- name: "{{ docker.service_name }}"
- state: restarted
-
-- name: reload docker
- ansible.builtin.service:
- name: "{{ docker.service_name }}"
- state: reloaded
diff --git a/configure/playbooks/roles/docker/tasks/create_docker_server_cert.yml b/configure/playbooks/roles/docker/tasks/create_docker_server_cert.yml
deleted file mode 100644
index 8f1de0f..0000000
--- a/configure/playbooks/roles/docker/tasks/create_docker_server_cert.yml
+++ /dev/null
@@ -1,67 +0,0 @@
----
-- name: Ensure docker cert dir exists
- ansible.builtin.file:
- path: "{{ docker.cert_dir }}"
- state: directory
- owner: "{{ docker.owner }}"
- group: "{{ docker.group }}"
- mode: 0700
-
-- name: Generate CA private key
- community.crypto.openssl_privatekey:
- path: "{{ docker.ca_key }}"
- owner: "{{ docker.owner }}"
- group: "{{ docker.group }}"
- mode: 0400
-
-- name: Generate CA CSR
- community.crypto.openssl_csr:
- path: "{{ docker.ca_csr }}"
- privatekey_path: "{{ docker.ca_key }}"
- common_name: "{{ xnat_container_service.host }}"
- subject_alt_name: "IP:{{ xnat_container_service.ip }}"
- basic_constraints_critical: true
- basic_constraints: ["CA:TRUE"]
-
-- name: Generate self-signed CA certificate
- community.crypto.x509_certificate:
- path: "{{ docker.ca_cert }}"
- privatekey_path: "{{ docker.ca_key }}"
- csr_path: "{{ docker.ca_csr }}"
- provider: selfsigned
- owner: "{{ docker.owner }}"
- group: "{{ docker.group }}"
- mode: 0400
- notify: restart docker
-
-- name: Generate server private key
- community.crypto.openssl_privatekey:
- path: "{{ docker.server_key }}"
- owner: "{{ docker.owner }}"
- group: "{{ docker.group }}"
- mode: 0400
-
-- name: Generate server CSR
- community.crypto.openssl_csr:
- path: "{{ docker.server_csr }}"
- privatekey_path: "{{ docker.server_key }}"
- common_name: "{{ xnat_container_service.host }}"
- subject_alt_name: "IP:{{ xnat_container_service.ip }}"
-
-- name: Generate server certificate
- community.crypto.x509_certificate:
- path: "{{ docker.server_cert }}"
- csr_path: "{{ docker.server_csr }}"
- provider: ownca
- ownca_path: "{{ docker.ca_cert }}"
- ownca_privatekey_path: "{{ docker.ca_key }}"
- owner: "{{ docker.owner }}"
- group: "{{ docker.group }}"
- mode: 0400
- notify: restart docker
-
-- name: Copy server certificate
- ansible.builtin.fetch:
- src: "{{ docker.ca_cert }}"
- dest: "{{ xnat_container_service_temp_files_cert_dir }}/ca.pem"
- flat: true
diff --git a/configure/playbooks/roles/docker/tasks/main.yml b/configure/playbooks/roles/docker/tasks/main.yml
deleted file mode 100644
index f6613a2..0000000
--- a/configure/playbooks/roles/docker/tasks/main.yml
+++ /dev/null
@@ -1,74 +0,0 @@
----
-- name: Ensure Ansible sefcontext dependencies are installed (Python 2)
- ansible.builtin.yum:
- name: ["libselinux-python", "policycoreutils-python"]
- state: installed
- when: ansible_facts["python"]["version"]["major"] is version("2")
-
-- name: Ensure Ansible sefcontext dependencies are installed (Python 3)
- ansible.builtin.yum:
- name: ["python3-libselinux", "policycoreutils-python-utils"]
- state: installed
- when: ansible_facts["python"]["version"]["major"] is version("3")
-
-- name: Ensure docker dependencies are installed
- ansible.builtin.yum:
- name: ["yum-utils", "device-mapper-persistent-data", "lvm2", "epel-release"]
- state: installed
-
-- name: Add Docker repository
- ansible.builtin.command: "yum-config-manager --add-repo={{ docker.repo_url }}"
- args:
- creates: /etc/yum.repos.d/docker.repo
-
-- name: Ensure docker is installed
- ansible.builtin.yum:
- name: ["docker-ce", "docker-ce-cli", "containerd.io"]
- state: installed
-
-- name: Ensure docker service directory {{ docker.service_file_dir }} exists
- ansible.builtin.file:
- path: "{{ docker.service_file_dir }}"
- owner: "root"
- group: "root"
- state: directory
- mode: 0700
-
-- name: Set custom docker service configuration
- ansible.builtin.template:
- src: docker.service.j2
- dest: "{{ docker.service_file_dir }}/docker.conf"
- owner: "root"
- group: "root"
- mode: 0644
- notify: reload docker
-
-- name: Ensure docker config directory {{ docker.config_dir }} exists
- ansible.builtin.file:
- path: "{{ docker.config_dir }}"
- owner: "{{ docker.owner }}"
- group: "{{ docker.group }}"
- state: directory
- mode: 0700
-
-- name: Write docker daemon configuration file
- ansible.builtin.template:
- src: daemon.json.j2
- dest: "{{ docker.daemon_conf_file }}"
- owner: "{{ docker.owner }}"
- group: "{{ docker.group }}"
- mode: 0640
- notify: reload docker
-
-- name: Generate container server certificate
- import_tasks: create_docker_server_cert.yml
- notify: restart docker
-
-- name: "Ensure docker service configuraiton is reloaded before restarting the service"
- ansible.builtin.meta: flush_handlers
-
-- name: Ensure docker daemon is running
- ansible.builtin.service:
- name: "{{ docker.service_name }}"
- state: started
- enabled: true
diff --git a/configure/playbooks/roles/docker/templates/daemon.json.j2 b/configure/playbooks/roles/docker/templates/daemon.json.j2
deleted file mode 100644
index 89108b4..0000000
--- a/configure/playbooks/roles/docker/templates/daemon.json.j2
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "hosts": ["tcp://{{ xnat_container_service.ip }}:{{ xnat_container_service.port }}", "unix:///var/run/docker.sock"],
- "tlsverify": true,
- "tlscacert": "{{ docker.ca_cert }}",
- "tlscert": "{{ docker.server_cert }}",
- "tlskey": "{{ docker.server_key }}"
- }
diff --git a/configure/playbooks/roles/docker/templates/docker.service.j2 b/configure/playbooks/roles/docker/templates/docker.service.j2
deleted file mode 100644
index 04c3d0e..0000000
--- a/configure/playbooks/roles/docker/templates/docker.service.j2
+++ /dev/null
@@ -1,5 +0,0 @@
-.include /lib/systemd/system/{{ docker.service_name }}.service
-
-[Service]
-ExecStart=
-ExecStart=/usr/bin/dockerd
diff --git a/configure/playbooks/roles/java/tasks/main.yml b/configure/playbooks/roles/java/tasks/main.yml
deleted file mode 100644
index 4cd508b..0000000
--- a/configure/playbooks/roles/java/tasks/main.yml
+++ /dev/null
@@ -1,12 +0,0 @@
----
-- name: ensure Java version {{ java.package }} is installed
- ansible.builtin.package:
- name: "{{ java.package }}"
- state: installed
-
-- name: Set JAVA_HOME through shell script
- ansible.builtin.template:
- src: "java_home.sh.j2"
- dest: "{{ java.profile_d }}/java_home.sh"
- mode: 0644
- when: java.home is defined and java.home != ''
diff --git a/configure/playbooks/roles/java/templates/java_home.sh.j2 b/configure/playbooks/roles/java/templates/java_home.sh.j2
deleted file mode 100644
index ab5bbdb..0000000
--- a/configure/playbooks/roles/java/templates/java_home.sh.j2
+++ /dev/null
@@ -1 +0,0 @@
-export JAVA_HOME="{{ java.home }}"
diff --git a/configure/playbooks/roles/provision/tasks/mount_efs.yml b/configure/playbooks/roles/mount_efs/tasks/main.yml
similarity index 56%
rename from configure/playbooks/roles/provision/tasks/mount_efs.yml
rename to configure/playbooks/roles/mount_efs/tasks/main.yml
index 6daf184..2df96df 100644
--- a/configure/playbooks/roles/provision/tasks/mount_efs.yml
+++ b/configure/playbooks/roles/mount_efs/tasks/main.yml
@@ -6,14 +6,14 @@
- name: Ensure mount directory exists
ansible.builtin.file:
- path: "{{ efs_mount.directory }}"
+ path: "{{ mount_efs_directory }}"
state: directory
mode: "0755"
- name: Mount the volume
ansible.posix.mount:
- src: "{{ efs_mount.src }}"
- name: "{{ efs_mount.directory }}"
- fstype: "{{ efs_mount.fstype }}"
- opts: "{{ efs_mount.opts }}"
- state: "{{ efs_mount.state }}"
+ src: "{{ mount_efs_src }}"
+ name: "{{ mount_efs_directory }}"
+ fstype: "{{ mount_efs_fstype }}"
+ opts: "{{ mount_efs_opts }}"
+ state: "{{ mount_efs_state }}"
diff --git a/configure/playbooks/roles/nginx/handlers/main.yml b/configure/playbooks/roles/nginx/handlers/main.yml
deleted file mode 100644
index adf8c39..0000000
--- a/configure/playbooks/roles/nginx/handlers/main.yml
+++ /dev/null
@@ -1,10 +0,0 @@
----
-- name: restart nginx
- ansible.builtin.service:
- name: nginx
- state: restarted
-
-- name: reload nginx
- ansible.builtin.service:
- name: nginx
- state: reloaded
diff --git a/configure/playbooks/roles/nginx/tasks/main.yml b/configure/playbooks/roles/nginx/tasks/main.yml
deleted file mode 100644
index 24f6f51..0000000
--- a/configure/playbooks/roles/nginx/tasks/main.yml
+++ /dev/null
@@ -1,88 +0,0 @@
----
-- name: Check if SELinux is in 'enforcing' mode
- ansible.builtin.lineinfile:
- path: /etc/selinux/config
- regexp: "^SELINUX=enforcing"
- state: absent
- check_mode: true
- changed_when: false
- register: selinux_enforced
-
-- name: Check SELinux flag on but VM off
- ansible.builtin.fail:
- msg: "SELinux flag enabled but disabled on VM"
- when: selinux_enabled and not selinux_enforced.found
-
-- name: Check SELinux flag off but VM on
- ansible.builtin.fail:
- msg: "SELinux flag disabled but enabled on VM"
- when: not selinux_enabled and selinux_enforced.found
-
-- name: Configure SELinux to allow nginx to listen on port {{ dicom_port }}
- community.general.seport:
- ports: "{{ dicom_port }}"
- proto: tcp
- setype: http_port_t
- state: present
- when: selinux_enabled
-
-# See: https://stackoverflow.com/a/24830777/17623640
-- name: Configure SELinux to allow httpd to act as relay and keep it persistent across reboots
- ansible.posix.seboolean:
- name: httpd_can_network_relay
- state: true
- persistent: true
-
-- name: Ensure epel is installed
- ansible.builtin.yum:
- name: "epel-release"
- state: installed
-
-- name: Ensure nginx is installed
- ansible.builtin.yum:
- name: ["nginx", "nginx-mod-stream"]
- state: installed
-
-- name: Ensure nginx certs directory exists
- ansible.builtin.file:
- path: "{{ nginx.certs_dir }}"
- owner: "{{ nginx.owner }}"
- group: "{{ nginx.group }}"
- state: directory
- mode: 0700
-
-- name: Copy server certificates to nginx
- ansible.builtin.copy:
- remote_src: true
- src: "{{ item.src }}"
- dest: "{{ item.dest }}"
- owner: "{{ nginx.owner }}"
- group: "{{ nginx.group }}"
- mode: 0600
- with_items:
- - { src: "{{ ssl.server_cert }}", dest: "{{ nginx.ssl_cert_file }}" }
- - { src: "{{ ssl.server_key }}", dest: "{{ nginx.ssl_key_file }}" }
- notify: reload nginx
- when: ssl.use_ssl
-
-- name: Generate Diffie-Hellman (DH) parameters with {{ diffie_helman_size_bits }} bits.
- community.crypto.openssl_dhparam:
- path: "{{ nginx.dh_params_file }}"
- size: "{{ diffie_helman_size_bits }}"
- notify: reload nginx
-
-- name: Copy nginx config file
- ansible.builtin.template:
- src: "nginx.j2"
- dest: "{{ nginx.conf_file }}"
- owner: "{{ nginx.owner }}"
- group: "{{ nginx.group }}"
- mode: 0644
- force: true
- notify: reload nginx
-
-- name: Ensure nginx is running
- ansible.builtin.service:
- name: nginx
- state: started
- enabled: true
diff --git a/configure/playbooks/roles/provision/tasks/locale.yml b/configure/playbooks/roles/provision/tasks/locale.yml
deleted file mode 100644
index d93aa62..0000000
--- a/configure/playbooks/roles/provision/tasks/locale.yml
+++ /dev/null
@@ -1,11 +0,0 @@
----
-- name: Install locale language pack
- ansible.builtin.yum:
- name: glibc-langpack-en
- state: present
-
-- name: Set locale # noqa: no-changed when
- ansible.builtin.command: "localectl set-locale LANGUAGE={{ server_locale | quote }}"
- register: set_locale
- failed_when: "'Failed to issue method call: ' in set_locale.stderr"
-
\ No newline at end of file
diff --git a/configure/playbooks/roles/provision/tasks/main.yml b/configure/playbooks/roles/provision/tasks/main.yml
deleted file mode 100644
index d0615bd..0000000
--- a/configure/playbooks/roles/provision/tasks/main.yml
+++ /dev/null
@@ -1,9 +0,0 @@
----
-- name: "Update packages"
- import_tasks: package_update.yml
-
-- name: "Set locale"
- import_tasks: locale.yml
-
-- name: "Mount EFS volume"
- ansible.builtin.include_tasks: "mount_efs.yml"
diff --git a/configure/playbooks/roles/provision/tasks/package_update.yml b/configure/playbooks/roles/provision/tasks/package_update.yml
deleted file mode 100644
index df68937..0000000
--- a/configure/playbooks/roles/provision/tasks/package_update.yml
+++ /dev/null
@@ -1,25 +0,0 @@
----
-- name: Ensure epel is installed
- become: true
- ansible.builtin.yum:
- name: "epel-release"
- state: installed
-
-- name: Disable default Postgres module (Red Hat 8+) # noqa command-instead-of-module
- ansible.builtin.command: yum module disable -y postgresql
- register: disable_postgresql_module
- changed_when:
- - "'Disabling modules:' in disable_postgresql_module.stdout"
-
-- name: Install PostgreSQL RPM key
- ansible.builtin.rpm_key:
- state: present
- key: "{{ postgresql_rpm_gpg_key_pgdg }}"
- when: "'cserv_hosts' not in group_names"
-
-- name: Ensure postgres RPM is installed on the web server
- ansible.builtin.yum:
- name: "{{ postgresql_install.rpm }}"
- state: present
- disable_gpg_check: "{{ postgresql_install.disable_gpg_check }}"
- when: "'web' in group_names"
diff --git a/configure/playbooks/roles/requirements.yml b/configure/playbooks/roles/requirements.yml
index f4e174a..5df3047 100644
--- a/configure/playbooks/roles/requirements.yml
+++ b/configure/playbooks/roles/requirements.yml
@@ -1,17 +1,8 @@
---
collections:
- - community.general
- - ansible.posix
- - community.docker
- - community.crypto
- - amazon.aws
-
-roles:
-
- - src: https://github.com/UCL-MIRSG/ansible-role-install-python.git
- version: 2023.02.9.0
- name: mirsg.install_python
-
- - src: https://github.com/UCL-MIRSG/ansible-role-ssl-certificates.git
- version: 2023.02.8.0
- name: mirsg.ssl_certificates
+ - name: ansible.posix
+ - name: amazon.aws
+ - name: mirsg.infrastructure
+ type: git
+ source: https://github.com/UCL-MIRSG/ansible-collection-infra.git
+ version: 1.22.0
diff --git a/configure/playbooks/roles/setup_xnat_db/tasks/main.yml b/configure/playbooks/roles/setup_xnat_db/tasks/main.yml
deleted file mode 100644
index 8698c8f..0000000
--- a/configure/playbooks/roles/setup_xnat_db/tasks/main.yml
+++ /dev/null
@@ -1,22 +0,0 @@
----
-- name: Ensure postgres is running
- ansible.builtin.service:
- name: "{{ postgresql_service.name }}"
- state: started
- enabled: true
-
-- name: "Create XNAT PostgreSQL user"
- become: true
- become_user: postgres
- community.postgresql.postgresql_user:
- name: "{{ xnat_db.postgres_xnat_user }}"
- password: "{{ xnat_db.postgres_xnat_password }}"
- port: "{{ xnat_db.port }}"
-
-- name: "Create XNAT PostgreSQL db"
- become: true
- become_user: postgres
- community.postgresql.postgresql_db:
- name: "{{ xnat_db.postgres_xnat_database }}"
- owner: "{{ xnat_db.postgres_xnat_user }}"
- port: "{{ xnat_db.port }}"
diff --git a/configure/playbooks/roles/setup_xnat_project/tasks/create_investigator.yml b/configure/playbooks/roles/setup_xnat_project/tasks/create_investigator.yml
index 3157fb1..02f78fb 100644
--- a/configure/playbooks/roles/setup_xnat_project/tasks/create_investigator.yml
+++ b/configure/playbooks/roles/setup_xnat_project/tasks/create_investigator.yml
@@ -3,7 +3,7 @@
# Returns 200 if created, 409 if already exists
- name: "Create new investigator"
ansible.builtin.uri:
- url: "{{ xnat_web_server.url }}/xapi/investigators/"
+ url: "{{ web_server.url }}/xapi/investigators/"
user: "{{ xnat_service_admin.username }}"
password: "{{ xnat_service_admin.password }}"
method: POST
diff --git a/configure/playbooks/roles/setup_xnat_project/tasks/create_owner.yml b/configure/playbooks/roles/setup_xnat_project/tasks/create_owner.yml
index 08e3d66..057e41b 100644
--- a/configure/playbooks/roles/setup_xnat_project/tasks/create_owner.yml
+++ b/configure/playbooks/roles/setup_xnat_project/tasks/create_owner.yml
@@ -3,7 +3,7 @@
# Returns 201 if created, 409 if already exists
- name: "Create project owner"
ansible.builtin.uri:
- url: "{{ xnat_web_server.url }}/xapi/users/"
+ url: "{{ web_server.url }}/xapi/users/"
user: "{{ xnat_service_admin.username }}"
password: "{{ xnat_service_admin.password }}"
method: POST
@@ -25,7 +25,7 @@
# Set project owner
- name: Make user owner of the project
ansible.builtin.uri:
- url: "{{ xnat_web_server.url }}/data/projects/{{ xnat_project.id }}/users/Owners/{{ xnat_project_owner.username }}"
+ url: "{{ web_server.url }}/data/projects/{{ xnat_project.id }}/users/Owners/{{ xnat_project_owner.username }}"
user: "{{ xnat_service_admin.username }}"
password: "{{ xnat_service_admin.password }}"
method: PUT
diff --git a/configure/playbooks/roles/setup_xnat_project/tasks/create_project.yml b/configure/playbooks/roles/setup_xnat_project/tasks/create_project.yml
index ee766f8..0c3b596 100644
--- a/configure/playbooks/roles/setup_xnat_project/tasks/create_project.yml
+++ b/configure/playbooks/roles/setup_xnat_project/tasks/create_project.yml
@@ -3,7 +3,7 @@
# Return 200 if created, 417 if already exists
- name: "Create I-BASH project if it doesn't exist"
ansible.builtin.uri:
- url: "{{ xnat_web_server.url }}/data/projects/"
+ url: "{{ web_server.url }}/data/projects/"
user: "{{ xnat_service_admin.username }}"
password: "{{ xnat_service_admin.password }}"
method: POST
@@ -18,7 +18,7 @@
- name: Make the project public
ansible.builtin.uri:
- url: "{{ xnat_web_server.url }}/data/projects/{{ xnat_project.id }}/accessibility/public"
+ url: "{{ web_server.url }}/data/projects/{{ xnat_project.id }}/accessibility/public"
user: "{{ xnat_service_admin.username }}"
password: "{{ xnat_service_admin.password }}"
method: PUT
diff --git a/configure/playbooks/roles/setup_xnat_project/tasks/upload_data.yml b/configure/playbooks/roles/setup_xnat_project/tasks/upload_data.yml
index d1971da..cfe7e92 100644
--- a/configure/playbooks/roles/setup_xnat_project/tasks/upload_data.yml
+++ b/configure/playbooks/roles/setup_xnat_project/tasks/upload_data.yml
@@ -1,3 +1,8 @@
+- name: Remove python3-requests
+ ansible.builtin.yum:
+ name: python3-requests
+ state: absent
+
- name: "Install necessary Python dependencies on host"
ansible.builtin.pip:
name:
diff --git a/configure/playbooks/roles/sign_docker_client_cert/tasks/main.yml b/configure/playbooks/roles/sign_docker_client_cert/tasks/main.yml
deleted file mode 100644
index 6d50f52..0000000
--- a/configure/playbooks/roles/sign_docker_client_cert/tasks/main.yml
+++ /dev/null
@@ -1,48 +0,0 @@
----
-- name: Ensure docker client cert dir exists on server
- ansible.builtin.file:
- path: "{{ docker.client_cert_dir }}"
- state: directory
- owner: "{{ docker.owner }}"
- group: "{{ docker.group }}"
- mode: 0700
-
-- name: Generate OpenSSL client private key
- community.crypto.openssl_privatekey:
- path: "{{ docker.client_cert_dir }}/key.pem"
- owner: "{{ docker.owner }}"
- group: "{{ docker.group }}"
- mode: 0400
-
-- name: Generate OpenSSL CSR for each client using private key
- community.crypto.openssl_csr:
- path: "{{ docker.client_cert_dir }}/{{ item }}.csr"
- privatekey_path: "{{ docker.client_cert_dir }}/key.pem"
- common_name: "{{ item }}"
- register: new_docker_client_csr_generated
- loop: "{{ clients }}"
-
-- name: Generate client certificates signed by server CA
- community.crypto.x509_certificate:
- path: "{{ docker.client_cert_dir }}/{{ item }}.cert"
- csr_path: "{{ docker.client_cert_dir }}/{{ item }}.csr"
- provider: ownca
- ownca_path: "{{ docker.ca_cert }}"
- ownca_privatekey_path: "{{ docker.ca_key }}"
- mode: 0400
- owner: "{{ docker.owner }}"
- group: "{{ docker.group }}"
- loop: "{{ clients }}"
-
-- name: Copy signed client certificates to temp dir on Ansible controller
- ansible.builtin.fetch:
- src: "{{ docker.client_cert_dir }}/{{ item }}.cert"
- dest: "{{ xnat_container_service_temp_files_cert_dir }}/{{ item }}.cert"
- flat: true
- loop: "{{ clients }}"
-
-- name: Copy private key to temp dir on Ansible controller
- ansible.builtin.fetch:
- src: "{{ docker.client_cert_dir }}/key.pem"
- dest: "{{ xnat_container_service_temp_files_cert_dir }}/key.pem"
- flat: true
diff --git a/configure/playbooks/roles/test-multiple_xnat_users/tasks/main.yml b/configure/playbooks/roles/test-multiple_xnat_users/tasks/main.yml
index fa99fbd..b1a53f3 100644
--- a/configure/playbooks/roles/test-multiple_xnat_users/tasks/main.yml
+++ b/configure/playbooks/roles/test-multiple_xnat_users/tasks/main.yml
@@ -13,7 +13,7 @@
loop_control:
loop_var: user_id
vars:
- xnat_web_url: "{{ xnat_web_server.url }}"
+ xnat_web_url: "{{ web_server.url }}"
admin_username: "{{ xnat_service_admin.username }}"
admin_password: "{{ xnat_service_admin.password }}"
ssl_certs: "{{ ssl.validate_certs }}"
diff --git a/configure/playbooks/roles/test-multiple_xnat_users/templates/.netrc-testuser.j2 b/configure/playbooks/roles/test-multiple_xnat_users/templates/.netrc-testuser.j2
index 130a6f8..26b37f1 100644
--- a/configure/playbooks/roles/test-multiple_xnat_users/templates/.netrc-testuser.j2
+++ b/configure/playbooks/roles/test-multiple_xnat_users/templates/.netrc-testuser.j2
@@ -1,3 +1,3 @@
-machine {{ xnat_web_server.host }}
+machine {{ web_server.host }}
login {{ user_name }}
password {{ user_password }}
diff --git a/configure/playbooks/roles/tomcat/handlers/main.yml b/configure/playbooks/roles/tomcat/handlers/main.yml
deleted file mode 100644
index 0050fa4..0000000
--- a/configure/playbooks/roles/tomcat/handlers/main.yml
+++ /dev/null
@@ -1,3 +0,0 @@
----
-- name: restart tomcat
- ansible.builtin.service: name=tomcat state=restarted
diff --git a/configure/playbooks/roles/tomcat/tasks/main.yml b/configure/playbooks/roles/tomcat/tasks/main.yml
deleted file mode 100644
index f83528c..0000000
--- a/configure/playbooks/roles/tomcat/tasks/main.yml
+++ /dev/null
@@ -1,107 +0,0 @@
----
-- name: Ensure Ansible sefcontext dependencies are installed (Python 2)
- ansible.builtin.yum:
- name: ["libselinux-python", "policycoreutils-python"]
- state: installed
- when: ansible_facts["python"]["version"]["major"] is version("2")
-
-- name: Ensure Ansible sefcontext dependencies are installed (Python 3)
- ansible.builtin.yum:
- name: ["python3-libselinux", "policycoreutils-python-utils"]
- state: installed
- when: ansible_facts["python"]["version"]["major"] is version("3")
-
-- name: Ensure epel is installed
- ansible.builtin.yum:
- name: "epel-release"
- state: installed
-
-- name: Ensure Tomcat Native library is installed
- ansible.builtin.yum:
- name: "tomcat-native"
- state: installed
-
-- name: Configure SELinux to allow Tomcat to listen on port {{ tomcat.port }}
- community.general.seport:
- ports: "{{ tomcat.port }}"
- proto: tcp
- setype: http_port_t
- state: present
- when: selinux_enabled
-
-- name: Add tomcat group
- ansible.builtin.group:
- name: "{{ tomcat.group }}"
-
-- name: Add "tomcat" user
- ansible.builtin.user:
- name: "{{ tomcat.owner }}"
- group: "{{ tomcat.group }}"
- home: "{{ tomcat.catalina_home }}"
- createhome: false
- system: true
-
-- name: Check for existing Tomcat install
- ansible.builtin.stat:
- path: "{{ tomcat.catalina_home }}/bin"
- register: tomcat_check
-
-- name: Check installed Tomcat version
- ansible.builtin.shell: |
- set -o pipefail
- ./version.sh | grep -oP '(?<=Apache Tomcat/)([0-9]+\.?)+'
- args:
- chdir: "{{ tomcat.catalina_home }}/bin"
- register: tomcat_check_version
- when: "tomcat_check.stat.exists"
- changed_when: false
- failed_when: false
-
-- name: Upgrade/install Tomcat if needed
- import_tasks: tasks/upgrade.yml
- when: "not tomcat_check.stat.exists or tomcat_version not in tomcat_check_version.stdout"
-
-- name: Copy tomcat service file
- ansible.builtin.template:
- src: templates/tomcat.service.j2
- dest: "{{ tomcat.service_config_file }}"
- mode: 0644
- when: ansible_service_mgr == "systemd"
-
-- name: Copy Tomcat config file
- ansible.builtin.template:
- src: tomcat.conf.j2
- dest: "{{ tomcat.config_file }}"
- owner: "{{ tomcat.owner }}"
- group: "{{ tomcat.group }}"
- mode: 0644
- force: true
- notify: restart tomcat
-
-- name: Start and enable tomcat
- ansible.builtin.service:
- daemon_reload: true
- name: tomcat
- state: started
- enabled: true
- when: ansible_service_mgr == "systemd"
-
-- name: Copy Tomcat setenv.sh file
- ansible.builtin.template:
- src: setenv.sh.j2
- dest: "{{ tomcat.catalina_home }}/bin/setenv.sh"
- owner: "{{ tomcat.owner }}"
- group: "{{ tomcat.group }}"
- mode: 0644
- force: true
- notify: restart tomcat
-
-- name: Copy Tomcat server config file
- ansible.builtin.template:
- src: server.xml.j2
- dest: "{{ tomcat.server_config_file }}"
- owner: "{{ tomcat.owner }}"
- group: "{{ tomcat.group }}"
- mode: 0644
- force: true
- notify: restart tomcat
diff --git a/configure/playbooks/roles/tomcat/tasks/upgrade.yml b/configure/playbooks/roles/tomcat/tasks/upgrade.yml
deleted file mode 100644
index f102f79..0000000
--- a/configure/playbooks/roles/tomcat/tasks/upgrade.yml
+++ /dev/null
@@ -1,92 +0,0 @@
----
-- name: Stop Tomcat
- ansible.builtin.service:
- name: tomcat
- state: stopped
- when: "tomcat_check.stat.exists"
-
-- name: Back up existing Tomcat {{ tomcat.catalina_home }}
- ansible.builtin.command: "mv {{ tomcat.catalina_home }} /usr/share/tomcat_bkp"
- args:
- creates: "/usr/share/tomcat_bkp"
- when: "tomcat_check.stat.exists"
-
-- name: Remove currently installed Tomcat folder
- ansible.builtin.file:
- path: "{{ tomcat.catalina_home }}"
- state: absent
-
-- name: Ensure Tomcat directory exists
- ansible.builtin.file:
- path: "{{ tomcat.catalina_home }}"
- state: directory
- owner: "{{ tomcat.owner }}"
- group: "{{ tomcat.group }}"
- mode: 0755
-
-- name: Download and unarchive Tomcat v{{ tomcat_version }}
- ansible.builtin.unarchive:
- src: "{{ tomcat.binary_url }}"
- dest: "{{ tomcat.catalina_home }}"
- remote_src: true
- owner: "{{ tomcat.owner }}"
- group: "{{ tomcat.group }}"
- extra_opts: "--strip-components=1"
- creates: "{{ tomcat.catalina_home }}/bin"
-
-- name: Remove default Tomcat webapps
- ansible.builtin.file:
- state: absent
- path: "{{ item }}"
- with_items:
- - "{{ tomcat.catalina_home }}/webapps/examples"
- - "{{ tomcat.catalina_home }}/webapps/manager"
- - "{{ tomcat.catalina_home }}/webapps/host-manager"
- - "{{ tomcat.catalina_home }}/webapps/docs"
-
-- name: Remove default Tomcat ROOT application
- ansible.builtin.file:
- state: absent
- path: "{{ tomcat.catalina_home }}/webapps/ROOT"
-
-- name: Check if a pipeline_installer exists
- ansible.builtin.stat:
- path: "/usr/share/tomcat_bkp/pipeline_installer"
- register: pipeline_installer_folder
-
-- name: "Restore pipeline installer if it exists"
- ansible.builtin.copy:
- src: "/usr/share/tomcat_bkp/pipeline_installer"
- dest: "{{ tomcat.catalina_home }}"
- owner: "{{ tomcat.owner }}"
- group: "{{ tomcat.group }}"
- mode: preserve
- remote_src: true
- when:
- - "tomcat_check.stat.exists"
- - "pipeline_installer_folder.stat.exists"
- notify: restart tomcat
-
-- name: "Restore previously installed XNAT and files"
- ansible.builtin.copy:
- src: "{{ item }}"
- dest: "{{ tomcat.catalina_home }}"
- owner: "{{ tomcat.owner }}"
- group: "{{ tomcat.group }}"
- mode: preserve
- remote_src: true
- with_items:
- - "/usr/share/tomcat_bkp/webapps"
- - "/usr/share/tomcat_bkp/.postgresql"
- - "/usr/share/tomcat_bkp/logs"
- - "/usr/share/tomcat_bkp/install_downloads"
- when: "tomcat_check.stat.exists"
- notify: restart tomcat
-
-- name: Show suggested commands for removing backed-up Tomcat folder
- ansible.builtin.debug:
- msg:
- - "A backup of the previously installed Tomcat folder was created at /usr/share/tomcat_bkp"
- - "You may wish to remove this"
- - "e.g sudo rm -rf /usr/share/tomcat_bkp"
- when: "tomcat_check.stat.exists"
diff --git a/configure/playbooks/roles/tomcat/templates/server.xml.j2 b/configure/playbooks/roles/tomcat/templates/server.xml.j2
deleted file mode 100644
index f14eaf9..0000000
--- a/configure/playbooks/roles/tomcat/templates/server.xml.j2
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
We received a request to create an account for you on SITE_NAME. If you made this request, please confirm your email address by clicking this link: Verify Email\n (This link will expire in 24 hours.)AUTO_ENABLE_TEXT
If you did not initiate this request, you can safely ignore this email.",
- "pathErrorWarning": "",
- "csrfEmailAlert": true,
- "showChangeJustification": false,
- "uiShowProjectManageFiles": true,
- "featureService": "org.nrg.xdat.security.services.impl.FeatureServiceImpl",
- "siteUrl": "{{ xnat_web_server.url }}",
- "passwordExpirationInterval": "2 years",
- "uiLoginFailureMessage": "The username or password you entered is incorrect. Please try again or reset your password.
After %d failed login attempts, your user account will be locked. If you believe your account is currently locked, you can: