From e2ffd564ceaf6643953752c44c75b91f8691638f Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Wed, 18 May 2022 14:09:49 +0000 Subject: [PATCH 01/31] Change to Payara 6 Alpha --- roles/payara/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/payara/defaults/main.yml b/roles/payara/defaults/main.yml index 16345d5..bfe661c 100644 --- a/roles/payara/defaults/main.yml +++ b/roles/payara/defaults/main.yml @@ -1,6 +1,6 @@ --- -payara_version: '5.2022.1' +payara_version: '6.2022.1.Alpha2' payara_directory: 'payara{{ payara_version }}' payara_domain: 'domain1' install_mysql_connector_java: '{{ ansible_local.local.instantiations.mariadb | default(false) }}' From c6bf346a3fbf3c8e5d111c3a29134d6fdfb923fc Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Wed, 18 May 2022 14:23:59 +0000 Subject: [PATCH 02/31] Upgrade to Java 11 versions --- roles/java/tasks/main.yml | 6 +++--- roles/payara/tasks/main.yml | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/roles/java/tasks/main.yml b/roles/java/tasks/main.yml index 428efe6..f4fed45 100644 --- a/roles/java/tasks/main.yml +++ b/roles/java/tasks/main.yml @@ -3,13 +3,13 @@ package: state: latest name: - - java-1.8.0-openjdk-headless - - java-1.8.0-openjdk-devel + - java-11-openjdk-headless + - java-11-openjdk-devel when: ansible_os_family == 'RedHat' and ansible_distribution_major_version == '7' - name: "Install java packages for Debian systems (Ubuntu 16.04 & 20.04)" package: state: latest name: - - openjdk-8-jdk-headless + - openjdk-11-jdk-headless when: ansible_os_family == 'Debian' and ( ansible_distribution_major_version == '16' or ansible_distribution_major_version == '20') diff --git a/roles/payara/tasks/main.yml b/roles/payara/tasks/main.yml index cef3c60..549fb93 100644 --- a/roles/payara/tasks/main.yml +++ b/roles/payara/tasks/main.yml @@ -132,15 +132,15 @@ - name: 'Make sure we are using the correct java version for payara for Debian systems (Ubuntu 16.04 & 20.04)' lineinfile: path: /home/{{ payara_user }}/{{ payara_directory }}/glassfish/config/asenv.conf - line: 'AS_JAVA="/usr/lib/jvm/java-1.8.0-openjdk-amd64"' - regexp: '^AS_JAVA="\/usr\/lib\/jvm\/java-1\.8\.0-openjdk-amd64"$' + line: 'AS_JAVA="/usr/lib/jvm/java-1.11.0-openjdk-amd64"' + regexp: '^AS_JAVA="\/usr\/lib\/jvm\/java-1\.11\.0-openjdk-amd64"$' when: ansible_os_family == 'Debian' and ( ansible_distribution_major_version == '16' or ansible_distribution_major_version == '20') - name: 'Make sure we are using the correct java version for payara for Red Hat systems (EL 7)' lineinfile: path: /home/{{ payara_user }}/{{ payara_directory }}/glassfish/config/asenv.conf - line: 'AS_JAVA="/usr/lib/jvm/java-1.8.0-openjdk"' - regexp: '^AS_JAVA="\/usr\/lib\/jvm\/java-1\.8\.0-openjdk"$' + line: 'AS_JAVA="/usr/lib/jvm/java-11-openjdk"' + regexp: '^AS_JAVA="\/usr\/lib\/jvm\/java-11-openjdk"$' when: ansible_os_family == 'RedHat' and ansible_distribution_major_version == '7' - name: 'Setup payara if not setup' From fa528785fe8f91e5b33a72e14d2abda7e073ade5 Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Mon, 23 May 2022 10:14:36 +0000 Subject: [PATCH 03/31] Add ability to specify and install snapshot versions --- group_vars/all/vars.yml | 13 ++++++++++++- roles/authn_anon/tasks/main.yml | 25 +++++++++++++++++++------ roles/authn_db/tasks/main.yml | 25 +++++++++++++++++++------ roles/authn_ldap/tasks/main.yml | 25 +++++++++++++++++++------ roles/authn_simple/tasks/main.yml | 25 +++++++++++++++++++------ roles/icat_lucene/tasks/main.yml | 25 +++++++++++++++++++------ roles/icat_server/tasks/main.yml | 25 +++++++++++++++++++------ roles/ids_server/tasks/main.yml | 25 +++++++++++++++++++------ roles/ids_storage_file/tasks/main.yml | 25 +++++++++++++++++++------ roles/topcat/tasks/main.yml | 25 +++++++++++++++++++------ 10 files changed, 183 insertions(+), 55 deletions(-) diff --git a/group_vars/all/vars.yml b/group_vars/all/vars.yml index 4af250a..0d643e2 100644 --- a/group_vars/all/vars.yml +++ b/group_vars/all/vars.yml @@ -59,4 +59,15 @@ topcat_url: "{{ ansible_fqdn }}" db_topcat_hostname: "localhost" topcat_database: "{{ vault_topcat_database }}" db_topcat_username: "{{ vault_db_topcat_username }}" -db_topcat_password: "{{ vault_db_topcat_password }}" \ No newline at end of file +db_topcat_password: "{{ vault_db_topcat_password }}" + +# Snapshot download URLs +#authn_anon_snapshot_url: "https://repo.icatproject.org/repo/org/icatproject/authn.anon/3.0.0-SNAPSHOT/authn.anon-3.0.0-20220512.125031-1-distro.zip" +#authn_db_snapshot_url: "https://repo.icatproject.org/repo/org/icatproject/authn.db/3.0.0-SNAPSHOT/authn.db-3.0.0-20220512.125133-1-distro.zip" +#authn_ldap_snapshot_url: "https://repo.icatproject.org/repo/org/icatproject/authn.ldap/3.0.0-SNAPSHOT/authn.ldap-3.0.0-20220512.125153-1-distro.zip" +#authn_simple_snapshot_url: "https://repo.icatproject.org/repo/org/icatproject/authn.simple/3.0.0-SNAPSHOT/authn.simple-3.0.0-20220512.125327-1-distro.zip" +#icat_lucene_snapshot_url: "https://repo.icatproject.org/repo/org/icatproject/icat.lucene/2.0.0-SNAPSHOT/icat.lucene-2.0.0-20220512.124921-1-distro.zip" +#icat_server_snapshot_url: "https://repo.icatproject.org/repo/org/icatproject/icat.server/6.0.0-SNAPSHOT/icat.server-6.0.0-20220512.124604-1-distro.zip" +#ids_server_snapshot_url: "https://repo.icatproject.org/repo/org/icatproject/ids.server/1.11.1-SNAPSHOT/ids.server-1.11.1-20200724.085739-1-distro.zip" +#ids_storage_file_snapshot_url: "" +#topcat_snapshot_url: "https://repo.icatproject.org/repo/org/icatproject/topcat/2.4.9-SNAPSHOT/topcat-2.4.9-20220427.112840-1-distro.zip" diff --git a/roles/authn_anon/tasks/main.yml b/roles/authn_anon/tasks/main.yml index c07b1c4..f47ab3e 100644 --- a/roles/authn_anon/tasks/main.yml +++ b/roles/authn_anon/tasks/main.yml @@ -1,12 +1,25 @@ --- +- name: "Extract SNAPSHOT version number when snapshot URL is given" + set_fact: + authn_anon_download_url: "{{ authn_anon_snapshot_url }}" + authn_anon_version: "{{ authn_anon_snapshot_url | regex_search( '[0-9]*.[0-9]*.[0-9]*-SNAPSHOT' ) }}" + authn_anon_download_filename: "{{ authn_anon_snapshot_url | regex_search('authn.anon.[^\/]*-distro.zip') }}" + when: authn_anon_snapshot_url is defined + +- name: "Set download URL when snapshot URL is not given" + set_fact: + authn_anon_download_url: https://repo.icatproject.org/repo/org/icatproject/authn.anon/{{ authn_anon_version }}/authn.anon-{{ authn_anon_version }}-distro.zip + authn_anon_download_filename: authn.anon-{{ authn_anon_version }}-distro.zip + when: authn_anon_snapshot_url is not defined + - name: "Check authn_anon package" stat: - path: /home/{{ payara_user }}/downloads/authn.anon-{{ authn_anon_version }}-distro.zip + path: /home/{{ payara_user }}/downloads/{{ authn_anon_download_filename }} register: packageResult - name: "Download authn_anon" get_url: - url: https://repo.icatproject.org/repo/org/icatproject/authn.anon/{{ authn_anon_version }}/authn.anon-{{ authn_anon_version }}-distro.zip + url: "{{ authn_anon_download_url }}" dest: /home/{{ payara_user }}/downloads owner: "{{ payara_user }}" group: "{{ payara_user }}" @@ -15,7 +28,7 @@ - name: "Unarchive authn_anon if not installed" unarchive: - src: /home/{{ payara_user }}/downloads/authn.anon-{{ authn_anon_version }}-distro.zip + src: /home/{{ payara_user }}/downloads/{{ authn_anon_download_filename }} dest: /home/{{ payara_user }}/install remote_src: true owner: "{{ payara_user }}" @@ -26,7 +39,7 @@ find: paths: /home/{{ payara_user }}/install/authn.anon/ use_regex: yes - patterns: "^.*-(?!{{ authn_anon_version }}).*\\.war$" + patterns: "^.*(? Date: Mon, 23 May 2022 11:15:49 +0000 Subject: [PATCH 04/31] Check for existing jar files for ids_storage_file --- roles/ids_storage_file/tasks/main.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/roles/ids_storage_file/tasks/main.yml b/roles/ids_storage_file/tasks/main.yml index f12ef68..73647a4 100644 --- a/roles/ids_storage_file/tasks/main.yml +++ b/roles/ids_storage_file/tasks/main.yml @@ -35,18 +35,19 @@ group: '{{ payara_user }}' when: ansible_local.local.instantiations.ids_storage_file is not defined or ansible_local.local.versions.ids_storage_file != ids_storage_file_version -- name: "Find any war files not matching the current version" +# IDS Storage File uses jar files, not war files like other ICAT components +- name: "Find any jar files not matching the current version" find: paths: /home/{{ payara_user }}/install/ids.storage_file/ use_regex: yes - patterns: "^.*(? Date: Mon, 23 May 2022 11:16:12 +0000 Subject: [PATCH 05/31] Setup Payara if a different version is found --- roles/payara/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/payara/tasks/main.yml b/roles/payara/tasks/main.yml index 549fb93..6ee2a3c 100644 --- a/roles/payara/tasks/main.yml +++ b/roles/payara/tasks/main.yml @@ -145,7 +145,7 @@ - name: 'Setup payara if not setup' import_tasks: tasks/installation.yml - when: (ansible_local is not defined) or (ansible_local.local is not defined) or (ansible_local.local.instantiations is not defined) or (ansible_local.local.instantiations.payara is not defined) or (ansible_local.local.instantiations.payara != 'true') + when: (ansible_local is not defined) or (ansible_local.local is not defined) or (ansible_local.local.instantiations is not defined) or (ansible_local.local.instantiations.payara is not defined) or (ansible_local.local.instantiations.payara != 'true') or (ansible_local.local.versions.payara != payara_version) - name: 'Check payara domain' stat: From c0a54c94fefda210c008da83c0c4086e9d2ce917 Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Mon, 23 May 2022 11:31:38 +0000 Subject: [PATCH 06/31] Remove old IDS Server snapshot URL --- group_vars/all/vars.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/group_vars/all/vars.yml b/group_vars/all/vars.yml index 0d643e2..dac32c5 100644 --- a/group_vars/all/vars.yml +++ b/group_vars/all/vars.yml @@ -68,6 +68,6 @@ db_topcat_password: "{{ vault_db_topcat_password }}" #authn_simple_snapshot_url: "https://repo.icatproject.org/repo/org/icatproject/authn.simple/3.0.0-SNAPSHOT/authn.simple-3.0.0-20220512.125327-1-distro.zip" #icat_lucene_snapshot_url: "https://repo.icatproject.org/repo/org/icatproject/icat.lucene/2.0.0-SNAPSHOT/icat.lucene-2.0.0-20220512.124921-1-distro.zip" #icat_server_snapshot_url: "https://repo.icatproject.org/repo/org/icatproject/icat.server/6.0.0-SNAPSHOT/icat.server-6.0.0-20220512.124604-1-distro.zip" -#ids_server_snapshot_url: "https://repo.icatproject.org/repo/org/icatproject/ids.server/1.11.1-SNAPSHOT/ids.server-1.11.1-20200724.085739-1-distro.zip" +#ids_server_snapshot_url: "" #ids_storage_file_snapshot_url: "" #topcat_snapshot_url: "https://repo.icatproject.org/repo/org/icatproject/topcat/2.4.9-SNAPSHOT/topcat-2.4.9-20220427.112840-1-distro.zip" From 962c3bb387df05feffd0f2d76d2105610d8a7088 Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Tue, 24 May 2022 09:39:53 +0000 Subject: [PATCH 07/31] Uncomment snapshot URL variables - This is so they can be used on GitHub Actions of the ICAT components that are being moved to Payara 6 --- group_vars/all/vars.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/group_vars/all/vars.yml b/group_vars/all/vars.yml index dac32c5..fcc6ba8 100644 --- a/group_vars/all/vars.yml +++ b/group_vars/all/vars.yml @@ -62,12 +62,12 @@ db_topcat_username: "{{ vault_db_topcat_username }}" db_topcat_password: "{{ vault_db_topcat_password }}" # Snapshot download URLs -#authn_anon_snapshot_url: "https://repo.icatproject.org/repo/org/icatproject/authn.anon/3.0.0-SNAPSHOT/authn.anon-3.0.0-20220512.125031-1-distro.zip" -#authn_db_snapshot_url: "https://repo.icatproject.org/repo/org/icatproject/authn.db/3.0.0-SNAPSHOT/authn.db-3.0.0-20220512.125133-1-distro.zip" -#authn_ldap_snapshot_url: "https://repo.icatproject.org/repo/org/icatproject/authn.ldap/3.0.0-SNAPSHOT/authn.ldap-3.0.0-20220512.125153-1-distro.zip" -#authn_simple_snapshot_url: "https://repo.icatproject.org/repo/org/icatproject/authn.simple/3.0.0-SNAPSHOT/authn.simple-3.0.0-20220512.125327-1-distro.zip" -#icat_lucene_snapshot_url: "https://repo.icatproject.org/repo/org/icatproject/icat.lucene/2.0.0-SNAPSHOT/icat.lucene-2.0.0-20220512.124921-1-distro.zip" -#icat_server_snapshot_url: "https://repo.icatproject.org/repo/org/icatproject/icat.server/6.0.0-SNAPSHOT/icat.server-6.0.0-20220512.124604-1-distro.zip" +authn_anon_snapshot_url: "https://repo.icatproject.org/repo/org/icatproject/authn.anon/3.0.0-SNAPSHOT/authn.anon-3.0.0-20220512.125031-1-distro.zip" +authn_db_snapshot_url: "https://repo.icatproject.org/repo/org/icatproject/authn.db/3.0.0-SNAPSHOT/authn.db-3.0.0-20220512.125133-1-distro.zip" +authn_ldap_snapshot_url: "https://repo.icatproject.org/repo/org/icatproject/authn.ldap/3.0.0-SNAPSHOT/authn.ldap-3.0.0-20220512.125153-1-distro.zip" +authn_simple_snapshot_url: "https://repo.icatproject.org/repo/org/icatproject/authn.simple/3.0.0-SNAPSHOT/authn.simple-3.0.0-20220512.125327-1-distro.zip" +icat_lucene_snapshot_url: "https://repo.icatproject.org/repo/org/icatproject/icat.lucene/2.0.0-SNAPSHOT/icat.lucene-2.0.0-20220512.124921-1-distro.zip" +icat_server_snapshot_url: "https://repo.icatproject.org/repo/org/icatproject/icat.server/6.0.0-SNAPSHOT/icat.server-6.0.0-20220512.124604-1-distro.zip" #ids_server_snapshot_url: "" #ids_storage_file_snapshot_url: "" -#topcat_snapshot_url: "https://repo.icatproject.org/repo/org/icatproject/topcat/2.4.9-SNAPSHOT/topcat-2.4.9-20220427.112840-1-distro.zip" +topcat_snapshot_url: "https://repo.icatproject.org/repo/org/icatproject/topcat/2.4.9-SNAPSHOT/topcat-2.4.9-20220427.112840-1-distro.zip" From 2fc28d3fa59f36db37dfa7b0e232791b8142325f Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Tue, 24 May 2022 09:56:09 +0000 Subject: [PATCH 08/31] Make Java version configurable - Set to Java 11 by default, ready for Payara 6 --- roles/java/defaults/main.yml | 4 ++++ roles/java/tasks/main.yml | 24 +++++++++++++----------- roles/java/vars/debian-java-11.yml | 3 +++ roles/java/vars/debian-java-8.yml | 3 +++ roles/java/vars/redhat-java-11.yml | 4 ++++ roles/java/vars/redhat-java-8.yml | 4 ++++ 6 files changed, 31 insertions(+), 11 deletions(-) create mode 100644 roles/java/defaults/main.yml create mode 100644 roles/java/vars/debian-java-11.yml create mode 100644 roles/java/vars/debian-java-8.yml create mode 100644 roles/java/vars/redhat-java-11.yml create mode 100644 roles/java/vars/redhat-java-8.yml diff --git a/roles/java/defaults/main.yml b/roles/java/defaults/main.yml new file mode 100644 index 0000000..4ef939c --- /dev/null +++ b/roles/java/defaults/main.yml @@ -0,0 +1,4 @@ +--- + +# Either choose '8' or '11' +java_version: '11' diff --git a/roles/java/tasks/main.yml b/roles/java/tasks/main.yml index f4fed45..1515528 100644 --- a/roles/java/tasks/main.yml +++ b/roles/java/tasks/main.yml @@ -1,15 +1,17 @@ --- -- name: "Install java packages for Red Hat systems (EL 7)" - package: - state: latest - name: - - java-11-openjdk-headless - - java-11-openjdk-devel - when: ansible_os_family == 'RedHat' and ansible_distribution_major_version == '7' +- include_vars: vars/redhat-java-8.yml + when: ansible_os_family == 'RedHat' and ansible_distribution_major_version == '7' and java_version == '8' + +- include_vars: vars/redhat-java-11.yml + when: ansible_os_family == 'RedHat' and ansible_distribution_major_version == '7' and java_version == '11' + +- include_vars: vars/debian-java-8.yml + when: ansible_os_family == 'Debian' and ( ansible_distribution_major_version == '16' or ansible_distribution_major_version == '20') and java_version == '8' + +- include_vars: vars/debian-java-11.yml + when: ansible_os_family == 'Debian' and ( ansible_distribution_major_version == '16' or ansible_distribution_major_version == '20') and java_version == '11' -- name: "Install java packages for Debian systems (Ubuntu 16.04 & 20.04)" +- name: "Install Java packages" package: state: latest - name: - - openjdk-11-jdk-headless - when: ansible_os_family == 'Debian' and ( ansible_distribution_major_version == '16' or ansible_distribution_major_version == '20') + name: "{{ java_pkgs }}" diff --git a/roles/java/vars/debian-java-11.yml b/roles/java/vars/debian-java-11.yml new file mode 100644 index 0000000..6a5d3b3 --- /dev/null +++ b/roles/java/vars/debian-java-11.yml @@ -0,0 +1,3 @@ +--- +java_pkgs: + - openjdk-11-jdk-headless diff --git a/roles/java/vars/debian-java-8.yml b/roles/java/vars/debian-java-8.yml new file mode 100644 index 0000000..6eab9e9 --- /dev/null +++ b/roles/java/vars/debian-java-8.yml @@ -0,0 +1,3 @@ +--- +java_pkgs: + - openjdk-8-jdk-headless diff --git a/roles/java/vars/redhat-java-11.yml b/roles/java/vars/redhat-java-11.yml new file mode 100644 index 0000000..8517904 --- /dev/null +++ b/roles/java/vars/redhat-java-11.yml @@ -0,0 +1,4 @@ +--- +java_pkgs: + - java-11-openjdk-headless + - java-11-openjdk-devel diff --git a/roles/java/vars/redhat-java-8.yml b/roles/java/vars/redhat-java-8.yml new file mode 100644 index 0000000..16fed39 --- /dev/null +++ b/roles/java/vars/redhat-java-8.yml @@ -0,0 +1,4 @@ +--- +java_pkgs: + - java-1.8.0-openjdk-headless + - java-1.8.0-openjdk-devel From a507c356e5cded9acfbf8ec2c5452c5b3a65a0dd Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Wed, 25 May 2022 14:03:30 +0000 Subject: [PATCH 09/31] Edit regex and configure Java version for Java check in Payara config --- roles/payara/tasks/main.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/roles/payara/tasks/main.yml b/roles/payara/tasks/main.yml index 6ee2a3c..41894ea 100644 --- a/roles/payara/tasks/main.yml +++ b/roles/payara/tasks/main.yml @@ -132,15 +132,15 @@ - name: 'Make sure we are using the correct java version for payara for Debian systems (Ubuntu 16.04 & 20.04)' lineinfile: path: /home/{{ payara_user }}/{{ payara_directory }}/glassfish/config/asenv.conf - line: 'AS_JAVA="/usr/lib/jvm/java-1.11.0-openjdk-amd64"' - regexp: '^AS_JAVA="\/usr\/lib\/jvm\/java-1\.11\.0-openjdk-amd64"$' + line: 'AS_JAVA="/usr/lib/jvm/java-1.{{ java_version }}.0-openjdk-amd64"' + regexp: '^AS_JAVA=' when: ansible_os_family == 'Debian' and ( ansible_distribution_major_version == '16' or ansible_distribution_major_version == '20') - name: 'Make sure we are using the correct java version for payara for Red Hat systems (EL 7)' lineinfile: path: /home/{{ payara_user }}/{{ payara_directory }}/glassfish/config/asenv.conf - line: 'AS_JAVA="/usr/lib/jvm/java-11-openjdk"' - regexp: '^AS_JAVA="\/usr\/lib\/jvm\/java-11-openjdk"$' + line: 'AS_JAVA="/usr/lib/jvm/java-{{ java_version }}-openjdk"' + regexp: '^AS_JAVA=' when: ansible_os_family == 'RedHat' and ansible_distribution_major_version == '7' - name: 'Setup payara if not setup' From ebba996f552678afdc2db3c19427a86c911aabb2 Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Wed, 25 May 2022 14:57:02 +0000 Subject: [PATCH 10/31] Refactor how ICAT components are downloaded --- group_vars/all/vars.yml | 11 ----------- roles/authn_anon/tasks/main.yml | 28 ++++++++++----------------- roles/authn_db/tasks/main.yml | 28 ++++++++++----------------- roles/authn_ldap/tasks/main.yml | 28 ++++++++++----------------- roles/authn_simple/tasks/main.yml | 28 ++++++++++----------------- roles/icat_lucene/tasks/main.yml | 28 ++++++++++----------------- roles/icat_server/tasks/main.yml | 28 ++++++++++----------------- roles/ids_server/tasks/main.yml | 28 ++++++++++----------------- roles/ids_storage_file/tasks/main.yml | 28 ++++++++++----------------- roles/topcat/tasks/main.yml | 28 ++++++++++----------------- 10 files changed, 90 insertions(+), 173 deletions(-) diff --git a/group_vars/all/vars.yml b/group_vars/all/vars.yml index fcc6ba8..d276b48 100644 --- a/group_vars/all/vars.yml +++ b/group_vars/all/vars.yml @@ -60,14 +60,3 @@ db_topcat_hostname: "localhost" topcat_database: "{{ vault_topcat_database }}" db_topcat_username: "{{ vault_db_topcat_username }}" db_topcat_password: "{{ vault_db_topcat_password }}" - -# Snapshot download URLs -authn_anon_snapshot_url: "https://repo.icatproject.org/repo/org/icatproject/authn.anon/3.0.0-SNAPSHOT/authn.anon-3.0.0-20220512.125031-1-distro.zip" -authn_db_snapshot_url: "https://repo.icatproject.org/repo/org/icatproject/authn.db/3.0.0-SNAPSHOT/authn.db-3.0.0-20220512.125133-1-distro.zip" -authn_ldap_snapshot_url: "https://repo.icatproject.org/repo/org/icatproject/authn.ldap/3.0.0-SNAPSHOT/authn.ldap-3.0.0-20220512.125153-1-distro.zip" -authn_simple_snapshot_url: "https://repo.icatproject.org/repo/org/icatproject/authn.simple/3.0.0-SNAPSHOT/authn.simple-3.0.0-20220512.125327-1-distro.zip" -icat_lucene_snapshot_url: "https://repo.icatproject.org/repo/org/icatproject/icat.lucene/2.0.0-SNAPSHOT/icat.lucene-2.0.0-20220512.124921-1-distro.zip" -icat_server_snapshot_url: "https://repo.icatproject.org/repo/org/icatproject/icat.server/6.0.0-SNAPSHOT/icat.server-6.0.0-20220512.124604-1-distro.zip" -#ids_server_snapshot_url: "" -#ids_storage_file_snapshot_url: "" -topcat_snapshot_url: "https://repo.icatproject.org/repo/org/icatproject/topcat/2.4.9-SNAPSHOT/topcat-2.4.9-20220427.112840-1-distro.zip" diff --git a/roles/authn_anon/tasks/main.yml b/roles/authn_anon/tasks/main.yml index f47ab3e..748f112 100644 --- a/roles/authn_anon/tasks/main.yml +++ b/roles/authn_anon/tasks/main.yml @@ -1,26 +1,18 @@ --- -- name: "Extract SNAPSHOT version number when snapshot URL is given" - set_fact: - authn_anon_download_url: "{{ authn_anon_snapshot_url }}" - authn_anon_version: "{{ authn_anon_snapshot_url | regex_search( '[0-9]*.[0-9]*.[0-9]*-SNAPSHOT' ) }}" - authn_anon_download_filename: "{{ authn_anon_snapshot_url | regex_search('authn.anon.[^\/]*-distro.zip') }}" - when: authn_anon_snapshot_url is defined - -- name: "Set download URL when snapshot URL is not given" - set_fact: - authn_anon_download_url: https://repo.icatproject.org/repo/org/icatproject/authn.anon/{{ authn_anon_version }}/authn.anon-{{ authn_anon_version }}-distro.zip - authn_anon_download_filename: authn.anon-{{ authn_anon_version }}-distro.zip - when: authn_anon_snapshot_url is not defined - - name: "Check authn_anon package" stat: - path: /home/{{ payara_user }}/downloads/{{ authn_anon_download_filename }} + path: /home/{{ payara_user }}/downloads/authn.anon-{{ authn_anon_version }}-distro.zip register: packageResult - name: "Download authn_anon" - get_url: - url: "{{ authn_anon_download_url }}" - dest: /home/{{ payara_user }}/downloads + community.general.maven_artifact: + repository_url: "https://repo.icatproject.org/repo" + group_id: "org.icatproject" + artifact_id: "authn.anon" + version: "{{ authn_anon_version }}" + classifier: "distro" + extension: "zip" + dest: "/home/{{ payara_user }}/downloads/n.anon-{{ authn_anon_version }}-distro.zip" owner: "{{ payara_user }}" group: "{{ payara_user }}" mode: 0664 @@ -28,7 +20,7 @@ - name: "Unarchive authn_anon if not installed" unarchive: - src: /home/{{ payara_user }}/downloads/{{ authn_anon_download_filename }} + src: /home/{{ payara_user }}/downloads/authn.anon-{{ authn_anon_version }}-distro.zip dest: /home/{{ payara_user }}/install remote_src: true owner: "{{ payara_user }}" diff --git a/roles/authn_db/tasks/main.yml b/roles/authn_db/tasks/main.yml index 1e19945..0521668 100644 --- a/roles/authn_db/tasks/main.yml +++ b/roles/authn_db/tasks/main.yml @@ -1,26 +1,18 @@ --- -- name: "Extract SNAPSHOT version number when snapshot URL is given" - set_fact: - authn_db_download_url: "{{ authn_db_snapshot_url }}" - authn_db_version: "{{ authn_db_snapshot_url | regex_search( '[0-9]*.[0-9]*.[0-9]*-SNAPSHOT' ) }}" - authn_db_download_filename: "{{ authn_db_snapshot_url | regex_search('authn.db.[^\/]*-distro.zip') }}" - when: authn_db_snapshot_url is defined - -- name: "Set download URL when snapshot URL is not given" - set_fact: - authn_db_download_url: https://repo.icatproject.org/repo/org/icatproject/authn.db/{{ authn_db_version }}/authn.db-{{ authn_db_version }}-distro.zip - authn_db_download_filename: authn.db-{{ authn_db_version }}-distro.zip - when: authn_db_snapshot_url is not defined - - name: "Check authn_db package" stat: - path: /home/{{ payara_user }}/downloads/{{ authn_db_download_filename }} + path: /home/{{ payara_user }}/downloads/authn.db-{{ authn_db_version }}-distro.zip register: packageResult - name: "Download authn_db" - get_url: - url: "{{ authn_db_download_url }}" - dest: /home/{{ payara_user }}/downloads + community.general.maven_artifact: + repository_url: "https://repo.icatproject.org/repo" + group_id: "org.icatproject" + artifact_id: "authn.db" + version: "{{ authn_db_version }}" + classifier: "distro" + extension: "zip" + dest: "/home/{{ payara_user }}/downloads/n.db-{{ authn_db_version }}-distro.zip" owner: "{{ payara_user }}" group: "{{ payara_user }}" mode: 0664 @@ -28,7 +20,7 @@ - name: 'Unarchive authn_db if not installed' unarchive: - src: /home/{{ payara_user }}/downloads/{{ authn_db_download_filename }} + src: /home/{{ payara_user }}/downloads/authn.db-{{ authn_db_version }}-distro.zip dest: /home/{{ payara_user }}/install remote_src: true owner: '{{ payara_user }}' diff --git a/roles/authn_ldap/tasks/main.yml b/roles/authn_ldap/tasks/main.yml index c1fe058..900863e 100644 --- a/roles/authn_ldap/tasks/main.yml +++ b/roles/authn_ldap/tasks/main.yml @@ -1,26 +1,18 @@ --- -- name: "Extract SNAPSHOT version number when snapshot URL is given" - set_fact: - authn_ldap_download_url: "{{ authn_ldap_snapshot_url }}" - authn_ldap_version: "{{ authn_ldap_snapshot_url | regex_search( '[0-9]*.[0-9]*.[0-9]*-SNAPSHOT' ) }}" - authn_ldap_download_filename: "{{ authn_ldap_snapshot_url | regex_search('authn.ldap.[^\/]*-distro.zip') }}" - when: authn_ldap_snapshot_url is defined - -- name: "Set download URL when snapshot URL is not given" - set_fact: - authn_ldap_download_url: https://repo.icatproject.org/repo/org/icatproject/authn.ldap/{{ authn_ldap_version }}/authn.ldap-{{ authn_ldap_version }}-distro.zip - authn_ldap_download_filename: authn.ldap-{{ authn_ldap_version }}-distro.zip - when: authn_ldap_snapshot_url is not defined - - name: "Check authn_ldap package" stat: - path: /home/{{ payara_user }}/downloads/{{ authn_ldap_download_filename }} + path: /home/{{ payara_user }}/downloads/authn.ldap-{{ authn_ldap_version }}-distro.zip register: packageResult - name: "Download authn_ldap" - get_url: - url: "{{ authn_ldap_download_url }}" - dest: /home/{{ payara_user }}/downloads + community.general.maven_artifact: + repository_url: "https://repo.icatproject.org/repo" + group_id: "org.icatproject" + artifact_id: "authn.ldap" + version: "{{ authn_ldap_version }}" + classifier: "distro" + extension: "zip" + dest: "/home/{{ payara_user }}/downloads/n.ldap-{{ authn_ldap_version }}-distro.zip" owner: "{{ payara_user }}" group: "{{ payara_user }}" mode: 0664 @@ -28,7 +20,7 @@ - name: "Unarchive authn_ldap if not installed" unarchive: - src: /home/{{ payara_user }}/downloads/{{ authn_ldap_download_filename }} + src: /home/{{ payara_user }}/downloads/authn.ldap-{{ authn_ldap_version }}-distro.zip dest: /home/{{ payara_user }}/install remote_src: true owner: "{{ payara_user }}" diff --git a/roles/authn_simple/tasks/main.yml b/roles/authn_simple/tasks/main.yml index 3ece396..bc077ac 100644 --- a/roles/authn_simple/tasks/main.yml +++ b/roles/authn_simple/tasks/main.yml @@ -1,26 +1,18 @@ --- -- name: "Extract SNAPSHOT version number when snapshot URL is given" - set_fact: - authn_simple_download_url: "{{ authn_simple_snapshot_url }}" - authn_simple_version: "{{ authn_simple_snapshot_url | regex_search( '[0-9]*.[0-9]*.[0-9]*-SNAPSHOT' ) }}" - authn_simple_download_filename: "{{ authn_simple_snapshot_url | regex_search('authn.simple.[^\/]*-distro.zip') }}" - when: authn_simple_snapshot_url is defined - -- name: "Set download URL when snapshot URL is not given" - set_fact: - authn_simple_download_url: https://repo.icatproject.org/repo/org/icatproject/authn.simple/{{ authn_simple_version }}/authn.simple-{{ authn_simple_version }}-distro.zip - authn_simple_download_filename: authn.simple-{{ authn_simple_version }}-distro.zip - when: authn_simple_snapshot_url is not defined - - name: "Check authn_simple package" stat: - path: /home/{{ payara_user }}/downloads/{{ authn_simple_download_filename }} + path: /home/{{ payara_user }}/downloads/authn.simple-{{ authn_simple_version }}-distro.zip register: packageResult - name: "Download authn_simple" - get_url: - url: "{{ authn_simple_download_url }}" - dest: /home/{{ payara_user }}/downloads + community.general.maven_artifact: + repository_url: "https://repo.icatproject.org/repo" + group_id: "org.icatproject" + artifact_id: "authn.simple" + version: "{{ authn_simple_version }}" + classifier: "distro" + extension: "zip" + dest: "/home/{{ payara_user }}/downloads/n.simple-{{ authn_simple_version }}-distro.zip" owner: "{{ payara_user }}" group: "{{ payara_user }}" mode: 0664 @@ -28,7 +20,7 @@ - name: 'Unarchive authn_simple if not installed' unarchive: - src: /home/{{ payara_user }}/downloads/{{ authn_simple_download_filename }} + src: /home/{{ payara_user }}/downloads/authn.simple-{{ authn_simple_version }}-distro.zip dest: /home/{{ payara_user }}/install remote_src: true owner: '{{ payara_user }}' diff --git a/roles/icat_lucene/tasks/main.yml b/roles/icat_lucene/tasks/main.yml index 8a8be1f..8ad8f0a 100644 --- a/roles/icat_lucene/tasks/main.yml +++ b/roles/icat_lucene/tasks/main.yml @@ -1,26 +1,18 @@ --- -- name: "Extract SNAPSHOT version number when snapshot URL is given" - set_fact: - icat_lucene_download_url: "{{ icat_lucene_snapshot_url }}" - icat_lucene_version: "{{ icat_lucene_snapshot_url | regex_search( '[0-9]*.[0-9]*.[0-9]*-SNAPSHOT' ) }}" - icat_lucene_download_filename: "{{ icat_lucene_snapshot_url | regex_search('icat.lucene.[^\/]*-distro.zip') }}" - when: icat_lucene_snapshot_url is defined - -- name: "Set download URL when snapshot URL is not given" - set_fact: - icat_lucene_download_url: https://repo.icatproject.org/repo/org/icatproject/icat.lucene/{{ icat_lucene_version }}/icat.lucene-{{ icat_lucene_version }}-distro.zip - icat_lucene_download_filename: icat.lucene-{{ icat_lucene_version }}-distro.zip - when: icat_lucene_snapshot_url is not defined - - name: "Check icat_lucene package" stat: - path: /home/{{ payara_user }}/downloads/{{ icat_lucene_download_filename }} + path: /home/{{ payara_user }}/downloads/icat.lucene-{{ icat_lucene_version }}-distro.zip register: packageResult - name: "Download icat_lucene" - get_url: - url: "{{ icat_lucene_download_url }}" - dest: /home/{{ payara_user }}/downloads + community.general.maven_artifact: + repository_url: "https://repo.icatproject.org/repo" + group_id: "org.icatproject" + artifact_id: "icat.lucene" + version: "{{ icat_lucene_version }}" + classifier: "distro" + extension: "zip" + dest: "/home/{{ payara_user }}/downloads/icat.lucene-{{ icat_lucene_version }}-distro.zip" owner: "{{ payara_user }}" group: "{{ payara_user }}" mode: 0664 @@ -28,7 +20,7 @@ - name: 'Unarchive icat_lucene if not installed' unarchive: - src: /home/{{ payara_user }}/downloads/{{ icat_lucene_download_filename }} + src: /home/{{ payara_user }}/downloads/icat.lucene-{{ icat_lucene_version }}-distro.zip dest: /home/{{ payara_user }}/install remote_src: true owner: '{{ payara_user }}' diff --git a/roles/icat_server/tasks/main.yml b/roles/icat_server/tasks/main.yml index 3e2f555..1ccdabe 100644 --- a/roles/icat_server/tasks/main.yml +++ b/roles/icat_server/tasks/main.yml @@ -13,28 +13,20 @@ state: latest name: "{{ icat_server_pkgs }}" -- name: "Extract SNAPSHOT version number when snapshot URL is given" - set_fact: - icat_server_download_url: "{{ icat_server_snapshot_url }}" - icat_server_version: "{{ icat_server_snapshot_url | regex_search( '[0-9]*.[0-9]*.[0-9]*-SNAPSHOT' ) }}" - icat_server_download_filename: "{{ icat_server_snapshot_url | regex_search('icat.server.[^\/]*-distro.zip') }}" - when: icat_server_snapshot_url is defined - -- name: "Set download URL when snapshot URL is not given" - set_fact: - icat_server_download_url: https://repo.icatproject.org/repo/org/icatproject/icat.server/{{ icat_server_version }}/icat.server-{{ icat_server_version }}-distro.zip - icat_server_download_filename: icat.server-{{ icat_server_version }}-distro.zip - when: icat_server_snapshot_url is not defined - - name: "Check icat_server package" stat: - path: /home/{{ payara_user }}/downloads/{{ icat_server_download_filename }} + path: /home/{{ payara_user }}/downloads/icat.server-{{ icat_server_version }}-distro.zip register: packageResult - name: "Download icat_server" - get_url: - url: "{{ icat_server_download_url }}" - dest: /home/{{ payara_user }}/downloads + community.general.maven_artifact: + repository_url: "https://repo.icatproject.org/repo" + group_id: "org.icatproject" + artifact_id: "icat.server" + version: "{{ icat_server_version }}" + classifier: "distro" + extension: "zip" + dest: "/home/{{ payara_user }}/downloads/icat.server-{{ icat_server_version }}-distro.zip" owner: "{{ payara_user }}" group: "{{ payara_user }}" mode: 0664 @@ -42,7 +34,7 @@ - name: "Unarchive icat_server if not installed" unarchive: - src: /home/{{ payara_user }}/downloads/{{ icat_server_download_filename }} + src: /home/{{ payara_user }}/downloads/icat.server-{{ icat_server_version }}-distro.zip dest: /home/{{ payara_user }}/install remote_src: true owner: "{{ payara_user }}" diff --git a/roles/ids_server/tasks/main.yml b/roles/ids_server/tasks/main.yml index a94abc4..5cf1a72 100644 --- a/roles/ids_server/tasks/main.yml +++ b/roles/ids_server/tasks/main.yml @@ -1,26 +1,18 @@ --- -- name: "Extract SNAPSHOT version number when snapshot URL is given" - set_fact: - ids_server_download_url: "{{ ids_server_snapshot_url }}" - ids_server_version: "{{ ids_server_snapshot_url | regex_search( '[0-9]*.[0-9]*.[0-9]*-SNAPSHOT' ) }}" - ids_server_download_filename: "{{ ids_server_snapshot_url | regex_search('ids.server.[^\/]*-distro.zip') }}" - when: ids_server_snapshot_url is defined - -- name: "Set download URL when snapshot URL is not given" - set_fact: - ids_server_download_url: https://repo.icatproject.org/repo/org/icatproject/ids.server/{{ ids_server_version }}/ids.server-{{ ids_server_version }}-distro.zip - ids_server_download_filename: ids.server-{{ ids_server_version }}-distro.zip - when: ids_server_snapshot_url is not defined - - name: "Check ids_server package" stat: - path: /home/{{ payara_user }}/downloads/{{ ids_server_download_filename }} + path: /home/{{ payara_user }}/downloads/ids.server-{{ ids_server_version }}-distro.zip register: packageResult - name: "Download ids_server" - get_url: - url: "{{ ids_server_download_url }}" - dest: /home/{{ payara_user }}/downloads + community.general.maven_artifact: + repository_url: "https://repo.icatproject.org/repo" + group_id: "org.icatproject" + artifact_id: "ids.server" + version: "{{ ids_server_version }}" + classifier: "distro" + extension: "zip" + dest: "/home/{{ payara_user }}/downloads/ids.server-{{ ids_server_version }}-distro.zip" owner: "{{ payara_user }}" group: "{{ payara_user }}" mode: 0664 @@ -28,7 +20,7 @@ - name: 'Unarchive ids_server if not installed' unarchive: - src: /home/{{ payara_user }}/downloads/{{ ids_server_download_filename }} + src: /home/{{ payara_user }}/downloads/ids.server-{{ ids_server_version }}-distro.zip dest: /home/{{ payara_user }}/install remote_src: true owner: '{{ payara_user }}' diff --git a/roles/ids_storage_file/tasks/main.yml b/roles/ids_storage_file/tasks/main.yml index 73647a4..553b2f8 100644 --- a/roles/ids_storage_file/tasks/main.yml +++ b/roles/ids_storage_file/tasks/main.yml @@ -1,26 +1,18 @@ --- -- name: "Extract SNAPSHOT version number when snapshot URL is given" - set_fact: - ids_storage_file_download_url: "{{ ids_storage_file_snapshot_url }}" - ids_storage_file_version: "{{ ids_storage_file_snapshot_url | regex_search( '[0-9]*.[0-9]*.[0-9]*-SNAPSHOT' ) }}" - ids_storage_file_download_filename: "{{ ids_storage_file_snapshot_url | regex_search('ids.storage_file.[^\/]*-distro.zip') }}" - when: ids_storage_file_snapshot_url is defined - -- name: "Set download URL when snapshot URL is not given" - set_fact: - ids_storage_file_download_url: https://repo.icatproject.org/repo/org/icatproject/ids.storage_file/{{ ids_storage_file_version }}/ids.storage_file-{{ ids_storage_file_version }}-distro.zip - ids_storage_file_download_filename: ids.storage_file-{{ ids_storage_file_version }}-distro.zip - when: ids_storage_file_snapshot_url is not defined - - name: "Check ids_storage_file package" stat: - path: /home/{{ payara_user }}/downloads/{{ ids_storage_file_download_filename }} + path: /home/{{ payara_user }}/downloads/ids.storage_file-{{ ids_storage_file_version }}-distro.zip register: packageResult - name: "Download ids_storage_file" - get_url: - url: "{{ ids_storage_file_download_url }}" - dest: /home/{{ payara_user }}/downloads + community.general.maven_artifact: + repository_url: "https://repo.icatproject.org/repo" + group_id: "org.icatproject" + artifact_id: "ids.storage_file" + version: "{{ ids_storage_file_version }}" + classifier: "distro" + extension: "zip" + dest: "/home/{{ payara_user }}/downloads/ids.storage_file-{{ ids_storage_file_version }}-distro.zip" owner: "{{ payara_user }}" group: "{{ payara_user }}" mode: 0664 @@ -28,7 +20,7 @@ - name: 'Unarchive ids_storage_file if not installed' unarchive: - src: /home/{{ payara_user }}/downloads/{{ ids_storage_file_download_filename }} + src: /home/{{ payara_user }}/downloads/ids.storage_file-{{ ids_storage_file_version }}-distro.zip dest: /home/{{ payara_user }}/install remote_src: true owner: '{{ payara_user }}' diff --git a/roles/topcat/tasks/main.yml b/roles/topcat/tasks/main.yml index 2d90e61..d4252c2 100644 --- a/roles/topcat/tasks/main.yml +++ b/roles/topcat/tasks/main.yml @@ -4,28 +4,20 @@ name: jq state: present -- name: "Extract SNAPSHOT version number when snapshot URL is given" - set_fact: - topcat_download_url: "{{ topcat_snapshot_url }}" - topcat_version: "{{ topcat_snapshot_url | regex_search( '[0-9]*.[0-9]*.[0-9]*-SNAPSHOT' ) }}" - topcat_download_filename: "{{ topcat_snapshot_url | regex_search('topcat.[^\/]*-distro.zip') }}" - when: topcat_snapshot_url is defined - -- name: "Set download URL when snapshot URL is not given" - set_fact: - topcat_download_url: https://repo.icatproject.org/repo/org/icatproject/topcat/{{ topcat_version }}/topcat-{{ topcat_version }}-distro.zip - topcat_download_filename: topcat-{{ topcat_version }}-distro.zip - when: topcat_snapshot_url is not defined - - name: "Check topcat package" stat: - path: /home/{{ payara_user }}/downloads/{{ topcat_download_filename }} + path: /home/{{ payara_user }}/downloads/topcat-{{ topcat_version }}-distro.zip register: packageResult - name: "Download topcat" - get_url: - url: "{{ topcat_download_url }}" - dest: /home/{{ payara_user }}/downloads + community.general.maven_artifact: + repository_url: "https://repo.icatproject.org/repo" + group_id: "org.icatproject" + artifact_id: "topcat" + version: "{{ topcat_version }}" + classifier: "distro" + extension: "zip" + dest: "/home/{{ payara_user }}/downloads/topcat-{{ topcat_version }}-distro.zip" owner: "{{ payara_user }}" group: "{{ payara_user }}" mode: 0664 @@ -33,7 +25,7 @@ - name: 'Unarchive topcat if not installed' unarchive: - src: /home/{{ payara_user }}/downloads/{{ topcat_download_filename }} + src: /home/{{ payara_user }}/downloads/topcat-{{ topcat_version }}-distro.zip dest: /home/{{ payara_user }}/install remote_src: true owner: '{{ payara_user }}' From c1ca0ffbd8638cb3f078be3230fbd09772739fc4 Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Wed, 25 May 2022 15:05:32 +0000 Subject: [PATCH 11/31] Update component versions to current snapshots --- roles/authn_anon/defaults/main.yml | 2 +- roles/authn_db/defaults/main.yml | 2 +- roles/authn_ldap/defaults/main.yml | 2 +- roles/authn_simple/defaults/main.yml | 2 +- roles/icat_lucene/defaults/main.yml | 2 +- roles/icat_server/defaults/main.yml | 2 +- roles/topcat/defaults/main.yml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/roles/authn_anon/defaults/main.yml b/roles/authn_anon/defaults/main.yml index 7b11e5f..e83a72e 100644 --- a/roles/authn_anon/defaults/main.yml +++ b/roles/authn_anon/defaults/main.yml @@ -1,2 +1,2 @@ --- -authn_anon_version: "2.0.1" +authn_anon_version: "3.0.0-SNAPSHOT" diff --git a/roles/authn_db/defaults/main.yml b/roles/authn_db/defaults/main.yml index f95b1a1..e5c4b1d 100644 --- a/roles/authn_db/defaults/main.yml +++ b/roles/authn_db/defaults/main.yml @@ -1,3 +1,3 @@ --- -authn_db_version: '2.0.1' +authn_db_version: '3.0.0-SNAPSHOT' diff --git a/roles/authn_ldap/defaults/main.yml b/roles/authn_ldap/defaults/main.yml index 9e5618f..21ae84d 100644 --- a/roles/authn_ldap/defaults/main.yml +++ b/roles/authn_ldap/defaults/main.yml @@ -1,4 +1,4 @@ --- -authn_ldap_version: "2.0.1" +authn_ldap_version: "3.0.0-SNAPSHOT" authn_ldap_provider_url: "ldap://logon05.fed.cclrc.ac.uk" authn_ldap_mechanism_enabled: true diff --git a/roles/authn_simple/defaults/main.yml b/roles/authn_simple/defaults/main.yml index 8d5d827..1019b19 100644 --- a/roles/authn_simple/defaults/main.yml +++ b/roles/authn_simple/defaults/main.yml @@ -1,3 +1,3 @@ --- -authn_simple_version: '2.0.1' +authn_simple_version: '3.0.0-SNAPSHOT' diff --git a/roles/icat_lucene/defaults/main.yml b/roles/icat_lucene/defaults/main.yml index eb0db3f..a3288be 100644 --- a/roles/icat_lucene/defaults/main.yml +++ b/roles/icat_lucene/defaults/main.yml @@ -1,4 +1,4 @@ --- -icat_lucene_version: '1.1.2' +icat_lucene_version: '2.0.0-SNAPSHOT' icat_lucene_data_dir: 'data/lucene' diff --git a/roles/icat_server/defaults/main.yml b/roles/icat_server/defaults/main.yml index d4bad35..b6354e8 100644 --- a/roles/icat_server/defaults/main.yml +++ b/roles/icat_server/defaults/main.yml @@ -1,6 +1,6 @@ --- -icat_server_version: '5.0.0' +icat_server_version: '6.0.0-SNAPSHOT' icat_server_rootUserNames: "{% if ansible_local.local.instantiations.authn_simple is defined and ansible_local.local.instantiations.authn_simple == 'true' %}simple/root {% endif %}{% if ansible_local.local.instantiations.authn_db is defined and ansible_local.local.instantiations.authn_db == 'true' %}db/root {% endif %}" icat_server_maxEntities: "10000" icat_server_authn_list: "{% if ansible_local.local.instantiations.authn_simple is defined and ansible_local.local.instantiations.authn_simple == 'true' %}simple {% endif %}{% if ansible_local.local.instantiations.authn_db is defined and ansible_local.local.instantiations.authn_db == 'true' %}db {% endif %}{% if ansible_local.local.instantiations.authn_anon is defined and ansible_local.local.instantiations.authn_anon == 'true' %}anon {% endif %}{% if ansible_local.local.instantiations.authn_ldap is defined and ansible_local.local.instantiations.authn_ldap == 'true' %}ldap {% endif %}{% if ansible_local.local.instantiations.authn_ip_clf is defined and ansible_local.local.instantiations.authn_ip_clf == 'true' %}ip_clf {% endif %}{% if ansible_local.local.instantiations.authn_uows_clf is defined and ansible_local.local.instantiations.authn_uows_clf == 'true' %}uows_clf {% endif %}" diff --git a/roles/topcat/defaults/main.yml b/roles/topcat/defaults/main.yml index 687cf06..c1886cc 100644 --- a/roles/topcat/defaults/main.yml +++ b/roles/topcat/defaults/main.yml @@ -1,3 +1,3 @@ --- -topcat_version: '2.4.9' +topcat_version: '2.4.9-SNAPSHOT' From d671d655d7287c37feab8cc03a758e1def04c527 Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Thu, 26 May 2022 06:33:06 +0000 Subject: [PATCH 12/31] Fix typos --- roles/authn_anon/tasks/main.yml | 2 +- roles/authn_db/tasks/main.yml | 2 +- roles/authn_ldap/tasks/main.yml | 2 +- roles/authn_simple/tasks/main.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/roles/authn_anon/tasks/main.yml b/roles/authn_anon/tasks/main.yml index 748f112..208f29e 100644 --- a/roles/authn_anon/tasks/main.yml +++ b/roles/authn_anon/tasks/main.yml @@ -12,7 +12,7 @@ version: "{{ authn_anon_version }}" classifier: "distro" extension: "zip" - dest: "/home/{{ payara_user }}/downloads/n.anon-{{ authn_anon_version }}-distro.zip" + dest: "/home/{{ payara_user }}/downloads/authn.anon-{{ authn_anon_version }}-distro.zip" owner: "{{ payara_user }}" group: "{{ payara_user }}" mode: 0664 diff --git a/roles/authn_db/tasks/main.yml b/roles/authn_db/tasks/main.yml index 0521668..19b1736 100644 --- a/roles/authn_db/tasks/main.yml +++ b/roles/authn_db/tasks/main.yml @@ -12,7 +12,7 @@ version: "{{ authn_db_version }}" classifier: "distro" extension: "zip" - dest: "/home/{{ payara_user }}/downloads/n.db-{{ authn_db_version }}-distro.zip" + dest: "/home/{{ payara_user }}/downloads/authn.db-{{ authn_db_version }}-distro.zip" owner: "{{ payara_user }}" group: "{{ payara_user }}" mode: 0664 diff --git a/roles/authn_ldap/tasks/main.yml b/roles/authn_ldap/tasks/main.yml index 900863e..7a246d7 100644 --- a/roles/authn_ldap/tasks/main.yml +++ b/roles/authn_ldap/tasks/main.yml @@ -12,7 +12,7 @@ version: "{{ authn_ldap_version }}" classifier: "distro" extension: "zip" - dest: "/home/{{ payara_user }}/downloads/n.ldap-{{ authn_ldap_version }}-distro.zip" + dest: "/home/{{ payara_user }}/downloads/authn.ldap-{{ authn_ldap_version }}-distro.zip" owner: "{{ payara_user }}" group: "{{ payara_user }}" mode: 0664 diff --git a/roles/authn_simple/tasks/main.yml b/roles/authn_simple/tasks/main.yml index bc077ac..81cf576 100644 --- a/roles/authn_simple/tasks/main.yml +++ b/roles/authn_simple/tasks/main.yml @@ -12,7 +12,7 @@ version: "{{ authn_simple_version }}" classifier: "distro" extension: "zip" - dest: "/home/{{ payara_user }}/downloads/n.simple-{{ authn_simple_version }}-distro.zip" + dest: "/home/{{ payara_user }}/downloads/authn.simple-{{ authn_simple_version }}-distro.zip" owner: "{{ payara_user }}" group: "{{ payara_user }}" mode: 0664 From fc3bec38f4553c5a50f618d9fc92a7aa323f94bf Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Thu, 26 May 2022 06:44:22 +0000 Subject: [PATCH 13/31] Add lxml to requirements - This is for use with the Maven artifact module --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 6d687ea..8099b12 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,2 @@ ansible==2.10.* +lxml==4.8.0 From 8e50925112dd1bb4de7f566d589fd1df0b446a02 Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Fri, 27 May 2022 11:24:18 +0000 Subject: [PATCH 14/31] Install lxml via apt on GitHub Actions --- .github/workflows/ci-build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index b7427d7..4d2cefd 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -38,6 +38,10 @@ jobs: sudo apt-get remove --purge "mysql*" sudo rm -rf /var/lib/mysql* /etc/mysql + # Needed for `maven_artifact` module on Ansible - lxml is in requirements.txt but doesn't seem to work on GitHub Actions + - name: Install lxml + run: sudo apt-get install python3-lxml + - name: Run ICAT Ansible Playbook run: | ansible-playbook hosts_all.yml -i hosts --vault-password-file vault_pass.txt -vv From 9a88b6f229a5e7b65739fa4a958757e6428c6ffe Mon Sep 17 00:00:00 2001 From: Alan Kyffin Date: Thu, 8 Sep 2022 14:10:39 +0100 Subject: [PATCH 15/31] Update ids.server and topcat/dgw-dl-api versions --- roles/ids_server/defaults/main.yml | 2 +- roles/topcat/defaults/main.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/ids_server/defaults/main.yml b/roles/ids_server/defaults/main.yml index ede8042..85fbe66 100644 --- a/roles/ids_server/defaults/main.yml +++ b/roles/ids_server/defaults/main.yml @@ -1,3 +1,3 @@ --- -ids_server_version: '1.12.0' +ids_server_version: '2.0.0-SNAPSHOT' diff --git a/roles/topcat/defaults/main.yml b/roles/topcat/defaults/main.yml index c1886cc..749a5e0 100644 --- a/roles/topcat/defaults/main.yml +++ b/roles/topcat/defaults/main.yml @@ -1,3 +1,3 @@ --- -topcat_version: '2.4.9-SNAPSHOT' +topcat_version: '3.0.0-SNAPSHOT' From 862b45a0af063fbec6348de46b34a7013f63d1ae Mon Sep 17 00:00:00 2001 From: Alan Kyffin Date: Fri, 9 Sep 2022 09:44:52 +0100 Subject: [PATCH 16/31] Create directory for ids.server filesCheck output --- roles/ids_server/tasks/main.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/roles/ids_server/tasks/main.yml b/roles/ids_server/tasks/main.yml index 5cf1a72..98aa82a 100644 --- a/roles/ids_server/tasks/main.yml +++ b/roles/ids_server/tasks/main.yml @@ -64,6 +64,14 @@ group: "{{ payara_user }}" mode: 0775 +- name: "Create filesCheck output directory" + file: + path: /home/{{ payara_user }}/logs + state: directory + owner: "{{ payara_user }}" + group: "{{ payara_user }}" + mode: 0775 + - name: "Check setup.properties file existence" local_action: stat path={{ role_path }}/files/setup.properties become: false From 6d631b8fc26bc7d9f13304519ba2984888ce7f29 Mon Sep 17 00:00:00 2001 From: Alan Kyffin Date: Mon, 7 Aug 2023 12:09:01 +0100 Subject: [PATCH 17/31] Update payara version to 6.2023.7 --- roles/payara/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/payara/defaults/main.yml b/roles/payara/defaults/main.yml index bfe661c..08ea089 100644 --- a/roles/payara/defaults/main.yml +++ b/roles/payara/defaults/main.yml @@ -1,6 +1,6 @@ --- -payara_version: '6.2022.1.Alpha2' +payara_version: '6.2023.7' payara_directory: 'payara{{ payara_version }}' payara_domain: 'domain1' install_mysql_connector_java: '{{ ansible_local.local.instantiations.mariadb | default(false) }}' From 915b447c217077cc8c73d1edf863486b63fd70ac Mon Sep 17 00:00:00 2001 From: Alan Kyffin Date: Mon, 7 Aug 2023 12:09:20 +0100 Subject: [PATCH 18/31] Add fix for https://github.com/payara/Payara/issues/6344 --- roles/payara/tasks/main.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/roles/payara/tasks/main.yml b/roles/payara/tasks/main.yml index 41894ea..68d43b9 100644 --- a/roles/payara/tasks/main.yml +++ b/roles/payara/tasks/main.yml @@ -143,6 +143,12 @@ regexp: '^AS_JAVA=' when: ansible_os_family == 'RedHat' and ansible_distribution_major_version == '7' +- name: 'Temporary fix for https://github.com/payara/Payara/issues/6344' + lineinfile: + path: /home/{{ payara_user }}/{{ payara_directory }}/glassfish/config/asenv.conf + line: 'export JAVA_TOOL_OPTIONS="-Djdk.util.zip.disableZip64ExtraFieldValidation=true --add-opens=java.base/java.io=ALL-UNNAMED"' + regexp: 'JAVA_TOOL_OPTIONS=' + - name: 'Setup payara if not setup' import_tasks: tasks/installation.yml when: (ansible_local is not defined) or (ansible_local.local is not defined) or (ansible_local.local.instantiations is not defined) or (ansible_local.local.instantiations.payara is not defined) or (ansible_local.local.instantiations.payara != 'true') or (ansible_local.local.versions.payara != payara_version) From 03b371cfabd393a976eb3fb59dc7ea65c10ebdcb Mon Sep 17 00:00:00 2001 From: Alan Kyffin Date: Mon, 7 Aug 2023 12:09:35 +0100 Subject: [PATCH 19/31] Update components to release versions --- roles/authn_anon/defaults/main.yml | 2 +- roles/authn_db/defaults/main.yml | 2 +- roles/authn_ldap/defaults/main.yml | 2 +- roles/authn_simple/defaults/main.yml | 2 +- roles/icat_lucene/defaults/main.yml | 2 +- roles/icat_server/defaults/main.yml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/roles/authn_anon/defaults/main.yml b/roles/authn_anon/defaults/main.yml index e83a72e..12598dc 100644 --- a/roles/authn_anon/defaults/main.yml +++ b/roles/authn_anon/defaults/main.yml @@ -1,2 +1,2 @@ --- -authn_anon_version: "3.0.0-SNAPSHOT" +authn_anon_version: "3.0.0" diff --git a/roles/authn_db/defaults/main.yml b/roles/authn_db/defaults/main.yml index e5c4b1d..9416f7d 100644 --- a/roles/authn_db/defaults/main.yml +++ b/roles/authn_db/defaults/main.yml @@ -1,3 +1,3 @@ --- -authn_db_version: '3.0.0-SNAPSHOT' +authn_db_version: '3.0.0' diff --git a/roles/authn_ldap/defaults/main.yml b/roles/authn_ldap/defaults/main.yml index 21ae84d..6662d74 100644 --- a/roles/authn_ldap/defaults/main.yml +++ b/roles/authn_ldap/defaults/main.yml @@ -1,4 +1,4 @@ --- -authn_ldap_version: "3.0.0-SNAPSHOT" +authn_ldap_version: "3.0.0" authn_ldap_provider_url: "ldap://logon05.fed.cclrc.ac.uk" authn_ldap_mechanism_enabled: true diff --git a/roles/authn_simple/defaults/main.yml b/roles/authn_simple/defaults/main.yml index 1019b19..4f4e0d5 100644 --- a/roles/authn_simple/defaults/main.yml +++ b/roles/authn_simple/defaults/main.yml @@ -1,3 +1,3 @@ --- -authn_simple_version: '3.0.0-SNAPSHOT' +authn_simple_version: '3.0.0' diff --git a/roles/icat_lucene/defaults/main.yml b/roles/icat_lucene/defaults/main.yml index a3288be..a31759a 100644 --- a/roles/icat_lucene/defaults/main.yml +++ b/roles/icat_lucene/defaults/main.yml @@ -1,4 +1,4 @@ --- -icat_lucene_version: '2.0.0-SNAPSHOT' +icat_lucene_version: '2.0.2' icat_lucene_data_dir: 'data/lucene' diff --git a/roles/icat_server/defaults/main.yml b/roles/icat_server/defaults/main.yml index b6354e8..af106fd 100644 --- a/roles/icat_server/defaults/main.yml +++ b/roles/icat_server/defaults/main.yml @@ -1,6 +1,6 @@ --- -icat_server_version: '6.0.0-SNAPSHOT' +icat_server_version: '6.0.0' icat_server_rootUserNames: "{% if ansible_local.local.instantiations.authn_simple is defined and ansible_local.local.instantiations.authn_simple == 'true' %}simple/root {% endif %}{% if ansible_local.local.instantiations.authn_db is defined and ansible_local.local.instantiations.authn_db == 'true' %}db/root {% endif %}" icat_server_maxEntities: "10000" icat_server_authn_list: "{% if ansible_local.local.instantiations.authn_simple is defined and ansible_local.local.instantiations.authn_simple == 'true' %}simple {% endif %}{% if ansible_local.local.instantiations.authn_db is defined and ansible_local.local.instantiations.authn_db == 'true' %}db {% endif %}{% if ansible_local.local.instantiations.authn_anon is defined and ansible_local.local.instantiations.authn_anon == 'true' %}anon {% endif %}{% if ansible_local.local.instantiations.authn_ldap is defined and ansible_local.local.instantiations.authn_ldap == 'true' %}ldap {% endif %}{% if ansible_local.local.instantiations.authn_ip_clf is defined and ansible_local.local.instantiations.authn_ip_clf == 'true' %}ip_clf {% endif %}{% if ansible_local.local.instantiations.authn_uows_clf is defined and ansible_local.local.instantiations.authn_uows_clf == 'true' %}uows_clf {% endif %}" From 8e8c6ba9ade49b65bf6665a5c2980fe1904210c6 Mon Sep 17 00:00:00 2001 From: Alan Kyffin Date: Mon, 7 Aug 2023 13:02:11 +0100 Subject: [PATCH 20/31] Replace topcat with datagateway-download-api --- group_vars/all/vars.yml | 5 +- hosts_all.yml | 2 +- icat_test_hosts.yml | 2 +- .../defaults/main.yml | 3 + .../files/logback.xml | 4 +- .../datagateway_download_api-handler.yml} | 4 +- .../handlers/main.yml | 4 + .../meta/main.yml | 0 .../tasks/create-setup-properties.yml | 20 +- .../tasks/installation.yml | 26 ++ roles/datagateway_download_api/tasks/main.yml | 121 +++++++++ .../templates/run.properties.j2} | 0 .../templates/setup.properties.j2} | 0 roles/topcat/defaults/main.yml | 3 - roles/topcat/handlers/main.yml | 4 - roles/topcat/tasks/create-topcat-json.yml | 118 --------- roles/topcat/tasks/installation.yml | 26 -- roles/topcat/tasks/main.yml | 244 ------------------ 18 files changed, 171 insertions(+), 415 deletions(-) create mode 100644 roles/datagateway_download_api/defaults/main.yml rename roles/{topcat => datagateway_download_api}/files/logback.xml (84%) rename roles/{topcat/handlers/topcat-handler.yml => datagateway_download_api/handlers/datagateway_download_api-handler.yml} (72%) create mode 100644 roles/datagateway_download_api/handlers/main.yml rename roles/{topcat => datagateway_download_api}/meta/main.yml (100%) rename roles/{topcat => datagateway_download_api}/tasks/create-setup-properties.yml (54%) create mode 100644 roles/datagateway_download_api/tasks/installation.yml create mode 100644 roles/datagateway_download_api/tasks/main.yml rename roles/{topcat/templates/topcat.properties.j2 => datagateway_download_api/templates/run.properties.j2} (100%) rename roles/{topcat/templates/topcat-setup.properties.j2 => datagateway_download_api/templates/setup.properties.j2} (100%) delete mode 100644 roles/topcat/defaults/main.yml delete mode 100644 roles/topcat/handlers/main.yml delete mode 100644 roles/topcat/tasks/create-topcat-json.yml delete mode 100644 roles/topcat/tasks/installation.yml delete mode 100644 roles/topcat/tasks/main.yml diff --git a/group_vars/all/vars.yml b/group_vars/all/vars.yml index d276b48..85703a2 100644 --- a/group_vars/all/vars.yml +++ b/group_vars/all/vars.yml @@ -52,10 +52,7 @@ icat_url: "{{ ansible_fqdn }}" # IDS server URL ids_url: "{{ ansible_fqdn }}" -# TopCat server URL -topcat_url: "{{ ansible_fqdn }}" - -# TopCat database hostname, database name, username and password +# DataGateway Download API database hostname, database name, username and password db_topcat_hostname: "localhost" topcat_database: "{{ vault_topcat_database }}" db_topcat_username: "{{ vault_db_topcat_username }}" diff --git a/hosts_all.yml b/hosts_all.yml index 619075a..5266bf5 100644 --- a/hosts_all.yml +++ b/hosts_all.yml @@ -17,5 +17,5 @@ - role: icat_server - role: ids_storage_file - role: ids_server - - role: topcat + - role: datagateway_download_api - role: dev_common diff --git a/icat_test_hosts.yml b/icat_test_hosts.yml index 1b2aa49..b135a3c 100644 --- a/icat_test_hosts.yml +++ b/icat_test_hosts.yml @@ -15,4 +15,4 @@ - role: icat_server - role: ids_storage_file - role: ids_server - - role: topcat + - role: datagateway_download_api diff --git a/roles/datagateway_download_api/defaults/main.yml b/roles/datagateway_download_api/defaults/main.yml new file mode 100644 index 0000000..c84b297 --- /dev/null +++ b/roles/datagateway_download_api/defaults/main.yml @@ -0,0 +1,3 @@ +--- + +datagateway_download_api_version: '3.0.1' diff --git a/roles/topcat/files/logback.xml b/roles/datagateway_download_api/files/logback.xml similarity index 84% rename from roles/topcat/files/logback.xml rename to roles/datagateway_download_api/files/logback.xml index b816415..8946664 100644 --- a/roles/topcat/files/logback.xml +++ b/roles/datagateway_download_api/files/logback.xml @@ -3,9 +3,9 @@ - ${HOME}/logs/topcat.log + ${HOME}/logs/datagateway-download-api.log - ${HOME}/logs/topcat.log.%d{yyyy-MM-dd}.%i.zip + ${HOME}/logs/datagateway-download-api.log.%d{yyyy-MM-dd}.%i.zip 30 tmp.json && mv tmp.json topcat.json - become: true - become_user: "{{ payara_user }}" - args: - chdir: /home/{{ payara_user }}/install/topcat - executable: /bin/bash - -- name: "Remove all facilities except LILS (the test facility)" - shell: 'cat topcat.json | jq ''{site, facilities: [ .facilities[] | select(.name == "LILS") ], plugins}'' > tmp.json && mv tmp.json topcat.json' - become: true - become_user: "{{ payara_user }}" - args: - chdir: /home/{{ payara_user }}/install/topcat - executable: /bin/bash - -- name: "Edit idsUrl in topcat.json" - shell: cat topcat.json | jq '.facilities[0].idsUrl = "https://{{ ids_url }}:8181"' > tmp.json && mv tmp.json topcat.json - become: true - become_user: "{{ payara_user }}" - args: - chdir: /home/{{ payara_user }}/install/topcat - executable: /bin/bash - -- name: "Edit icatUrl in topcat.json" - shell: cat topcat.json | jq '.facilities[0].icatUrl = "https://{{ icat_url }}:8181"' > tmp.json && mv tmp.json topcat.json - become: true - become_user: "{{ payara_user }}" - args: - chdir: /home/{{ payara_user }}/install/topcat - executable: /bin/bash - -- name: "Set authenticationTypes to [] in LILS facility in topcat.json" - shell: cat topcat.json | jq '.facilities[0].authenticationTypes = []' > tmp.json && mv tmp.json topcat.json - become: true - become_user: "{{ payara_user }}" - args: - chdir: /home/{{ payara_user }}/install/topcat - executable: /bin/bash - -- name: "Add Simple authn in topcat.json" - shell: 'cat topcat.json | jq ''.facilities[0].authenticationTypes += [{"title": "Simple", "plugin": "simple"}]'' > tmp.json && mv tmp.json topcat.json' - become: true - become_user: "{{ payara_user }}" - args: - chdir: /home/{{ payara_user }}/install/topcat - executable: /bin/bash - when: ansible_local.local.instantiations.authn_simple is defined and ansible_local.local.instantiations.authn_simple == 'true' - -- name: "Add DB authn in topcat.json" - shell: 'cat topcat.json | jq ''.facilities[0].authenticationTypes += [{"title": "DB", "plugin": "db"}]'' > tmp.json && mv tmp.json topcat.json' - become: true - become_user: "{{ payara_user }}" - args: - chdir: /home/{{ payara_user }}/install/topcat - executable: /bin/bash - when: ansible_local.local.instantiations.authn_db is defined and ansible_local.local.instantiations.authn_db == 'true' - -- name: "Add Anon authn in topcat.json" - shell: 'cat topcat.json | jq ''.facilities[0].authenticationTypes += [{"title": "Anonymous", "plugin": "anon"}]'' > tmp.json && mv tmp.json topcat.json' - become: true - become_user: "{{ payara_user }}" - args: - chdir: /home/{{ payara_user }}/install/topcat - executable: /bin/bash - when: ansible_local.local.instantiations.authn_anon is defined and ansible_local.local.instantiations.authn_anon == 'true' - -- name: "Add LDAP authn in topcat.json" - shell: 'cat topcat.json | jq ''.facilities[0].authenticationTypes += [{"title": "LDAP", "plugin": "ldap"}]'' > tmp.json && mv tmp.json topcat.json' - become: true - become_user: "{{ payara_user }}" - args: - chdir: /home/{{ payara_user }}/install/topcat - executable: /bin/bash - when: ansible_local.local.instantiations.authn_ldap is defined and ansible_local.local.instantiations.authn_ldap == 'true' - -- name: "Set http transport type in topcat.json" - shell: cat topcat.json | jq '.facilities[0].downloadTransportTypes[0].type = "http"' > tmp.json && mv tmp.json topcat.json - become: true - become_user: "{{ payara_user }}" - args: - chdir: /home/{{ payara_user }}/install/topcat - executable: /bin/bash - -- name: "Edit http download idsUrl in topcat.json" - shell: cat topcat.json | jq '.facilities[0].downloadTransportTypes[0].idsUrl = "http://{{ ids_url }}:8080"' > tmp.json && mv tmp.json topcat.json - become: true - become_user: "{{ payara_user }}" - args: - chdir: /home/{{ payara_user }}/install/topcat - executable: /bin/bash - -- name: "Set https transport type in topcat.json" - shell: cat topcat.json | jq '.facilities[0].downloadTransportTypes[1].type = "https"' > tmp.json && mv tmp.json topcat.json - become: true - become_user: "{{ payara_user }}" - args: - chdir: /home/{{ payara_user }}/install/topcat - executable: /bin/bash - -- name: "Edit https download idsUrl in topcat.json" - shell: cat topcat.json | jq '.facilities[0].downloadTransportTypes[1].idsUrl = "https://{{ ids_url }}:8181"' > tmp.json && mv tmp.json topcat.json - become: true - become_user: "{{ payara_user }}" - args: - chdir: /home/{{ payara_user }}/install/topcat - executable: /bin/bash - -- name: "Remove intermediate file" - file: - path: /home/{{ payara_user }}/install/topcat/tmp.json - state: absent - -- name: "Set mode of topcat.json" - file: - path: /home/{{ payara_user }}/install/topcat/topcat.json - mode: 0664 diff --git a/roles/topcat/tasks/installation.yml b/roles/topcat/tasks/installation.yml deleted file mode 100644 index 6434df7..0000000 --- a/roles/topcat/tasks/installation.yml +++ /dev/null @@ -1,26 +0,0 @@ ---- - -- name: 'Setup topcat' - include_tasks: handlers/topcat-handler.yml - -- name: 'Set fact on host to record that topcat has been instantiated' - ini_file: - path: /etc/ansible/facts.d/local.fact - section: 'instantiations' - option: 'topcat' - value: 'true' - no_extra_spaces: true - create: false - -- name: 'Set fact on host to record version of topcat that has been instantiated' - ini_file: - path: /etc/ansible/facts.d/local.fact - section: 'versions' - option: 'topcat' - value: '{{ topcat_version }}' - no_extra_spaces: true - create: false - -- name: "Force ansible to regather local facts to recognise icat_lucene installation" - setup: - filter: ansible_local diff --git a/roles/topcat/tasks/main.yml b/roles/topcat/tasks/main.yml deleted file mode 100644 index d4252c2..0000000 --- a/roles/topcat/tasks/main.yml +++ /dev/null @@ -1,244 +0,0 @@ ---- -- name: "Install jq package" - package: - name: jq - state: present - -- name: "Check topcat package" - stat: - path: /home/{{ payara_user }}/downloads/topcat-{{ topcat_version }}-distro.zip - register: packageResult - -- name: "Download topcat" - community.general.maven_artifact: - repository_url: "https://repo.icatproject.org/repo" - group_id: "org.icatproject" - artifact_id: "topcat" - version: "{{ topcat_version }}" - classifier: "distro" - extension: "zip" - dest: "/home/{{ payara_user }}/downloads/topcat-{{ topcat_version }}-distro.zip" - owner: "{{ payara_user }}" - group: "{{ payara_user }}" - mode: 0664 - when: packageResult.stat.exists is defined and packageResult.stat.exists == false - -- name: 'Unarchive topcat if not installed' - unarchive: - src: /home/{{ payara_user }}/downloads/topcat-{{ topcat_version }}-distro.zip - dest: /home/{{ payara_user }}/install - remote_src: true - owner: '{{ payara_user }}' - group: '{{ payara_user }}' - when: ansible_local.local.instantiations.topcat is not defined or ansible_local.local.versions.topcat != topcat_version - -- name: "Find any war files not matching the current version" - find: - paths: /home/{{ payara_user }}/install/topcat/ - use_regex: yes - patterns: "^.*(? Date: Mon, 7 Aug 2023 14:54:12 +0100 Subject: [PATCH 21/31] Create JKS format trust store to work with the javax.net.ssl.trustStore property --- roles/dev_common/tasks/main.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/roles/dev_common/tasks/main.yml b/roles/dev_common/tasks/main.yml index c3076cf..caff75f 100644 --- a/roles/dev_common/tasks/main.yml +++ b/roles/dev_common/tasks/main.yml @@ -35,6 +35,17 @@ group: "{{ payara_user }}" mode: 0664 +# Payara 6+ creates its trust store in PKCS12 format, however the javax.net.ssl.trustStore parameter in ~/.m2/settings.xml only seems to work with JKS format +- name: "Create JKS-format trust store" + command: + cmd: keytool -importkeystore -srckeystore /home/{{ payara_user }}/{{ payara_directory }}/glassfish/domains/{{ payara_domain }}/config/cacerts.p12 -destkeystore /home/{{ payara_user }}/{{ payara_directory }}/glassfish/domains/{{ payara_domain }}/config/cacerts.jks -deststoretype jks + stdin: | + changeit + changeit + changeit + args: + creates: /home/{{ payara_user }}/{{ payara_directory }}/glassfish/domains/{{ payara_domain }}/config/cacerts.jks + - name: "Make test ids main folder" file: path: /home/{{ payara_user }}/test/data/ids/main From 00c6adfb76a3dbd47f3c95a5ebfdc93de677cc64 Mon Sep 17 00:00:00 2001 From: Alan Kyffin Date: Tue, 8 Aug 2023 11:55:34 +0100 Subject: [PATCH 22/31] Improve package installation --- roles/common/tasks/main.yml | 11 +---------- roles/dev_common/meta/main.yml | 1 + roles/dev_common/tasks/main.yml | 19 ++++++++++--------- roles/dev_common/vars/debian-16.yml | 5 ----- roles/dev_common/vars/debian-20.yml | 5 ----- roles/dev_common/vars/redhat.yml | 5 ----- roles/icat_server/tasks/main.yml | 9 +++------ roles/icat_server/vars/debian-16.yml | 4 ---- .../vars/{debian-20.yml => debian.yml} | 0 roles/java/defaults/main.yml | 2 +- roles/java/tasks/main.yml | 15 +++++---------- roles/java/vars/debian-java-11.yml | 3 --- roles/java/vars/debian-java-8.yml | 3 --- roles/java/vars/debian.yml | 6 ++++++ roles/java/vars/redhat-java-11.yml | 4 ---- roles/java/vars/redhat-java-8.yml | 4 ---- roles/java/vars/redhat.yml | 6 ++++++ roles/mariadb/tasks/main.yml | 9 +++------ roles/mariadb/vars/debian-20.yml | 9 --------- .../vars/{debian-16.yml => debian.yml} | 2 +- roles/payara/tasks/main.yml | 12 ++---------- 21 files changed, 39 insertions(+), 95 deletions(-) delete mode 100644 roles/dev_common/vars/debian-16.yml delete mode 100644 roles/dev_common/vars/debian-20.yml delete mode 100644 roles/dev_common/vars/redhat.yml delete mode 100644 roles/icat_server/vars/debian-16.yml rename roles/icat_server/vars/{debian-20.yml => debian.yml} (100%) delete mode 100644 roles/java/vars/debian-java-11.yml delete mode 100644 roles/java/vars/debian-java-8.yml create mode 100644 roles/java/vars/debian.yml delete mode 100644 roles/java/vars/redhat-java-11.yml delete mode 100644 roles/java/vars/redhat-java-8.yml create mode 100644 roles/java/vars/redhat.yml delete mode 100644 roles/mariadb/vars/debian-20.yml rename roles/mariadb/vars/{debian-16.yml => debian.yml} (85%) diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml index b3710e9..09af7bd 100644 --- a/roles/common/tasks/main.yml +++ b/roles/common/tasks/main.yml @@ -1,17 +1,8 @@ --- -- name: "Update apt cache if running on Debian system" - apt: - update_cache: yes - when: ansible_os_family == 'Debian' - -- name: "Update yum cache if running on RedHat system" - yum: - update_cache: yes - when: ansible_os_family == 'RedHat' - name: "Installing common packages" package: - state: latest + state: present name: - htop - unzip diff --git a/roles/dev_common/meta/main.yml b/roles/dev_common/meta/main.yml index de3a75e..866f952 100644 --- a/roles/dev_common/meta/main.yml +++ b/roles/dev_common/meta/main.yml @@ -1,4 +1,5 @@ --- dependencies: + - role: java - role: payara diff --git a/roles/dev_common/tasks/main.yml b/roles/dev_common/tasks/main.yml index caff75f..6bca9be 100644 --- a/roles/dev_common/tasks/main.yml +++ b/roles/dev_common/tasks/main.yml @@ -1,17 +1,18 @@ --- -- include_vars: vars/redhat.yml - when: ansible_os_family == 'RedHat' -- include_vars: vars/debian-16.yml - when: ansible_os_family == 'Debian' and ansible_distribution_major_version == '16' - -- include_vars: vars/debian-20.yml - when: ansible_os_family == 'Debian' and ansible_distribution_major_version == '20' +- name: "Install Java -devel package (RedHat only)" + package: + state: present + name: "java-{{ java_version }}-openjdk-devel" + when: ansible_os_family == "RedHat" - name: "Installing common dev packages" package: - state: latest - name: "{{ dev_common_pkgs }}" + state: present + name: + - git + - maven + - python3-pip - name: "Installing common dev python packages" pip: diff --git a/roles/dev_common/vars/debian-16.yml b/roles/dev_common/vars/debian-16.yml deleted file mode 100644 index 5ec3227..0000000 --- a/roles/dev_common/vars/debian-16.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -dev_common_pkgs: - - git - - maven - - python-pip diff --git a/roles/dev_common/vars/debian-20.yml b/roles/dev_common/vars/debian-20.yml deleted file mode 100644 index 33695c3..0000000 --- a/roles/dev_common/vars/debian-20.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -dev_common_pkgs: - - git - - maven - - python3-pip diff --git a/roles/dev_common/vars/redhat.yml b/roles/dev_common/vars/redhat.yml deleted file mode 100644 index 5ec3227..0000000 --- a/roles/dev_common/vars/redhat.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -dev_common_pkgs: - - git - - maven - - python-pip diff --git a/roles/icat_server/tasks/main.yml b/roles/icat_server/tasks/main.yml index 1ccdabe..e7c7420 100644 --- a/roles/icat_server/tasks/main.yml +++ b/roles/icat_server/tasks/main.yml @@ -2,15 +2,12 @@ - include_vars: vars/redhat.yml when: ansible_os_family == 'RedHat' -- include_vars: vars/debian-16.yml - when: ansible_os_family == 'Debian' and ansible_distribution_major_version == '16' - -- include_vars: vars/debian-20.yml - when: ansible_os_family == 'Debian' and ansible_distribution_major_version == '20' +- include_vars: vars/debian.yml + when: ansible_os_family == 'Debian' - name: "Install common icat_server dependencies" package: - state: latest + state: present name: "{{ icat_server_pkgs }}" - name: "Check icat_server package" diff --git a/roles/icat_server/vars/debian-16.yml b/roles/icat_server/vars/debian-16.yml deleted file mode 100644 index d52cbb0..0000000 --- a/roles/icat_server/vars/debian-16.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -icat_server_pkgs: - - python-suds - - python-requests diff --git a/roles/icat_server/vars/debian-20.yml b/roles/icat_server/vars/debian.yml similarity index 100% rename from roles/icat_server/vars/debian-20.yml rename to roles/icat_server/vars/debian.yml diff --git a/roles/java/defaults/main.yml b/roles/java/defaults/main.yml index 4ef939c..dbef904 100644 --- a/roles/java/defaults/main.yml +++ b/roles/java/defaults/main.yml @@ -1,4 +1,4 @@ --- -# Either choose '8' or '11' +# Either choose '11' or '17' java_version: '11' diff --git a/roles/java/tasks/main.yml b/roles/java/tasks/main.yml index 1515528..2140cc0 100644 --- a/roles/java/tasks/main.yml +++ b/roles/java/tasks/main.yml @@ -1,17 +1,12 @@ --- -- include_vars: vars/redhat-java-8.yml - when: ansible_os_family == 'RedHat' and ansible_distribution_major_version == '7' and java_version == '8' -- include_vars: vars/redhat-java-11.yml - when: ansible_os_family == 'RedHat' and ansible_distribution_major_version == '7' and java_version == '11' +- include_vars: vars/redhat.yml + when: ansible_os_family == 'RedHat' -- include_vars: vars/debian-java-8.yml - when: ansible_os_family == 'Debian' and ( ansible_distribution_major_version == '16' or ansible_distribution_major_version == '20') and java_version == '8' - -- include_vars: vars/debian-java-11.yml - when: ansible_os_family == 'Debian' and ( ansible_distribution_major_version == '16' or ansible_distribution_major_version == '20') and java_version == '11' +- include_vars: vars/debian.yml + when: ansible_os_family == 'Debian' - name: "Install Java packages" package: - state: latest + state: present name: "{{ java_pkgs }}" diff --git a/roles/java/vars/debian-java-11.yml b/roles/java/vars/debian-java-11.yml deleted file mode 100644 index 6a5d3b3..0000000 --- a/roles/java/vars/debian-java-11.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -java_pkgs: - - openjdk-11-jdk-headless diff --git a/roles/java/vars/debian-java-8.yml b/roles/java/vars/debian-java-8.yml deleted file mode 100644 index 6eab9e9..0000000 --- a/roles/java/vars/debian-java-8.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -java_pkgs: - - openjdk-8-jdk-headless diff --git a/roles/java/vars/debian.yml b/roles/java/vars/debian.yml new file mode 100644 index 0000000..bb71894 --- /dev/null +++ b/roles/java/vars/debian.yml @@ -0,0 +1,6 @@ +--- + +java_pkgs: + - openjdk-{{ java_version }}-jdk-headless + +java_dir: /usr/lib/jvm/java-{{ java_version }}-openjdk-amd64 diff --git a/roles/java/vars/redhat-java-11.yml b/roles/java/vars/redhat-java-11.yml deleted file mode 100644 index 8517904..0000000 --- a/roles/java/vars/redhat-java-11.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -java_pkgs: - - java-11-openjdk-headless - - java-11-openjdk-devel diff --git a/roles/java/vars/redhat-java-8.yml b/roles/java/vars/redhat-java-8.yml deleted file mode 100644 index 16fed39..0000000 --- a/roles/java/vars/redhat-java-8.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -java_pkgs: - - java-1.8.0-openjdk-headless - - java-1.8.0-openjdk-devel diff --git a/roles/java/vars/redhat.yml b/roles/java/vars/redhat.yml new file mode 100644 index 0000000..b1f115b --- /dev/null +++ b/roles/java/vars/redhat.yml @@ -0,0 +1,6 @@ +--- + +java_pkgs: + - java-{{ java_version }}-openjdk-headless + +java_dir: /usr/lib/jvm/java-{{ java_version }}-openjdk diff --git a/roles/mariadb/tasks/main.yml b/roles/mariadb/tasks/main.yml index ecfd370..d9996a7 100644 --- a/roles/mariadb/tasks/main.yml +++ b/roles/mariadb/tasks/main.yml @@ -2,15 +2,12 @@ - include_vars: vars/redhat.yml when: ansible_os_family == 'RedHat' -- include_vars: vars/debian-16.yml - when: ansible_os_family == 'Debian' and ansible_distribution_major_version == '16' - -- include_vars: vars/debian-20.yml - when: ansible_os_family == 'Debian' and ansible_distribution_major_version == '20' +- include_vars: vars/debian.yml + when: ansible_os_family == 'Debian' - name: "Install mariadb packages" package: - state: latest + state: present name: "{{ mariadb_pkgs }}" - name: "Configure default storage engine" diff --git a/roles/mariadb/vars/debian-20.yml b/roles/mariadb/vars/debian-20.yml deleted file mode 100644 index 864ed90..0000000 --- a/roles/mariadb/vars/debian-20.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -mariadb_daemon: mysql -mariadb_config_dir: /etc/mysql/conf.d -mariadb_pkgs: - - mariadb-client-10.3 - - mariadb-server-10.3 - - mariadb-server - - mariadb-client - - python3-mysqldb diff --git a/roles/mariadb/vars/debian-16.yml b/roles/mariadb/vars/debian.yml similarity index 85% rename from roles/mariadb/vars/debian-16.yml rename to roles/mariadb/vars/debian.yml index df768c3..63afea4 100644 --- a/roles/mariadb/vars/debian-16.yml +++ b/roles/mariadb/vars/debian.yml @@ -4,4 +4,4 @@ mariadb_config_dir: /etc/mysql/conf.d mariadb_pkgs: - mariadb-server - mariadb-client - - python-mysqldb + - python3-mysqldb diff --git a/roles/payara/tasks/main.yml b/roles/payara/tasks/main.yml index 68d43b9..5e91b6a 100644 --- a/roles/payara/tasks/main.yml +++ b/roles/payara/tasks/main.yml @@ -129,19 +129,11 @@ executable: /bin/bash when: installationResult.stat.exists is defined and installationResult.stat.exists == false -- name: 'Make sure we are using the correct java version for payara for Debian systems (Ubuntu 16.04 & 20.04)' +- name: 'Make sure we are using the correct java version for payara' lineinfile: path: /home/{{ payara_user }}/{{ payara_directory }}/glassfish/config/asenv.conf - line: 'AS_JAVA="/usr/lib/jvm/java-1.{{ java_version }}.0-openjdk-amd64"' + line: 'AS_JAVA="{{ java_dir }}"' regexp: '^AS_JAVA=' - when: ansible_os_family == 'Debian' and ( ansible_distribution_major_version == '16' or ansible_distribution_major_version == '20') - -- name: 'Make sure we are using the correct java version for payara for Red Hat systems (EL 7)' - lineinfile: - path: /home/{{ payara_user }}/{{ payara_directory }}/glassfish/config/asenv.conf - line: 'AS_JAVA="/usr/lib/jvm/java-{{ java_version }}-openjdk"' - regexp: '^AS_JAVA=' - when: ansible_os_family == 'RedHat' and ansible_distribution_major_version == '7' - name: 'Temporary fix for https://github.com/payara/Payara/issues/6344' lineinfile: From baba74a27a5eb701d1d210ce23a639af3df81e67 Mon Sep 17 00:00:00 2001 From: Alan Kyffin Date: Tue, 8 Aug 2023 12:33:08 +0100 Subject: [PATCH 23/31] Make Payara and domain installation path configurable --- .../templates/mariadb.setup.properties.j2 | 4 ++-- .../templates/oracle.setup.properties.j2 | 2 +- roles/authn_db/templates/setup.properties.j2 | 4 ++-- roles/dev_common/tasks/main.yml | 4 ++-- roles/dev_common/templates/settings.xml.j2 | 4 ++-- roles/payara/defaults/main.yml | 3 ++- roles/payara/tasks/main.yml | 22 +++++++++---------- roles/payara/templates/payara-init.j2 | 2 +- roles/payara/templates/setup.properties.j2 | 2 +- 9 files changed, 24 insertions(+), 23 deletions(-) diff --git a/roles/authn_db/templates/mariadb.setup.properties.j2 b/roles/authn_db/templates/mariadb.setup.properties.j2 index dad9539..c11d4c4 100644 --- a/roles/authn_db/templates/mariadb.setup.properties.j2 +++ b/roles/authn_db/templates/mariadb.setup.properties.j2 @@ -1,11 +1,11 @@ # Glassfish secure = true container = Glassfish -home = /home/{{ payara_user }}/{{ payara_directory }} +home = {{ payara_dir }} port = 4848 # MySQL db.driver = com.mysql.jdbc.jdbc2.optional.MysqlDataSource db.url = jdbc:mysql://{{ db_icat_hostname }}:{{ db_icat_mariadb_port }}/{{ icat_database }} db.username = {{ db_icat_username }} -db.password = {{ db_icat_password }} \ No newline at end of file +db.password = {{ db_icat_password }} diff --git a/roles/authn_db/templates/oracle.setup.properties.j2 b/roles/authn_db/templates/oracle.setup.properties.j2 index f79e3a6..688f5fa 100644 --- a/roles/authn_db/templates/oracle.setup.properties.j2 +++ b/roles/authn_db/templates/oracle.setup.properties.j2 @@ -1,7 +1,7 @@ # Glassfish secure = true container = Glassfish -home = /home/{{ payara_user }}/{{ payara_directory }} +home = {{ payara_dir }} port = 4848 # Oracle diff --git a/roles/authn_db/templates/setup.properties.j2 b/roles/authn_db/templates/setup.properties.j2 index dad9539..c11d4c4 100644 --- a/roles/authn_db/templates/setup.properties.j2 +++ b/roles/authn_db/templates/setup.properties.j2 @@ -1,11 +1,11 @@ # Glassfish secure = true container = Glassfish -home = /home/{{ payara_user }}/{{ payara_directory }} +home = {{ payara_dir }} port = 4848 # MySQL db.driver = com.mysql.jdbc.jdbc2.optional.MysqlDataSource db.url = jdbc:mysql://{{ db_icat_hostname }}:{{ db_icat_mariadb_port }}/{{ icat_database }} db.username = {{ db_icat_username }} -db.password = {{ db_icat_password }} \ No newline at end of file +db.password = {{ db_icat_password }} diff --git a/roles/dev_common/tasks/main.yml b/roles/dev_common/tasks/main.yml index 6bca9be..6489fa7 100644 --- a/roles/dev_common/tasks/main.yml +++ b/roles/dev_common/tasks/main.yml @@ -39,13 +39,13 @@ # Payara 6+ creates its trust store in PKCS12 format, however the javax.net.ssl.trustStore parameter in ~/.m2/settings.xml only seems to work with JKS format - name: "Create JKS-format trust store" command: - cmd: keytool -importkeystore -srckeystore /home/{{ payara_user }}/{{ payara_directory }}/glassfish/domains/{{ payara_domain }}/config/cacerts.p12 -destkeystore /home/{{ payara_user }}/{{ payara_directory }}/glassfish/domains/{{ payara_domain }}/config/cacerts.jks -deststoretype jks + cmd: keytool -importkeystore -srckeystore {{ payara_domain_dir }}/config/cacerts.p12 -destkeystore {{ payara_domain_dir }}/config/cacerts.jks -deststoretype jks stdin: | changeit changeit changeit args: - creates: /home/{{ payara_user }}/{{ payara_directory }}/glassfish/domains/{{ payara_domain }}/config/cacerts.jks + creates: "{{ payara_domain_dir }}/config/cacerts.jks" - name: "Make test ids main folder" file: diff --git a/roles/dev_common/templates/settings.xml.j2 b/roles/dev_common/templates/settings.xml.j2 index 0e53a7f..03c281f 100644 --- a/roles/dev_common/templates/settings.xml.j2 +++ b/roles/dev_common/templates/settings.xml.j2 @@ -9,8 +9,8 @@ {% if lucene_url is defined and lucene_url %} https://{{ lucene_url }}:8181 {% endif %} - /home/{{ payara_user }}/{{ payara_directory }}/glassfish/domains/{{ payara_domain }}/config/cacerts.jks - /home/{{ payara_user }}/{{ payara_directory }} + {{ payara_domain_dir }}/config/cacerts.jks + {{ payara_dir }} /home/{{ payara_user }}/test diff --git a/roles/payara/defaults/main.yml b/roles/payara/defaults/main.yml index 08ea089..658f711 100644 --- a/roles/payara/defaults/main.yml +++ b/roles/payara/defaults/main.yml @@ -1,8 +1,9 @@ --- payara_version: '6.2023.7' -payara_directory: 'payara{{ payara_version }}' +payara_dir: '/home/{{ payara_user }}/payara{{ payara_version }}' payara_domain: 'domain1' +payara_domain_dir: '{{ payara_dir }}/glassfish/domains/{{ payara_domain }}' install_mysql_connector_java: '{{ ansible_local.local.instantiations.mariadb | default(false) }}' mysql_connector_java_version: 5.1.49 install_ojdbc8_jar: false diff --git a/roles/payara/tasks/main.yml b/roles/payara/tasks/main.yml index 5e91b6a..941129e 100644 --- a/roles/payara/tasks/main.yml +++ b/roles/payara/tasks/main.yml @@ -60,15 +60,15 @@ - name: 'Add path to payara executable to PATH variable in .bash_profile' lineinfile: path: /home/{{ payara_user }}/.bash_profile - line: 'export PATH=$HOME/{{ payara_directory }}/bin:$PATH' - regexp: '^export PATH=\$HOME\/payara[0-9]+(\.{1}[0-9]+)*\/bin:\$PATH$' + line: 'export PATH={{ payara_dir }}/bin:$PATH' + regexp: '^export PATH=\/.*\/payara.*\/bin:\$PATH$' when: bashProfileResult.stat.exists is defined and bashProfileResult.stat.exists == true - name: 'Add path to payara executable to PATH variable in .profile' lineinfile: path: /home/{{ payara_user }}/.profile - line: 'export PATH=$HOME/{{ payara_directory }}/bin:$PATH' - regexp: '^export PATH=\$HOME\/payara[0-9]+(\.{1}[0-9]+)*\/bin:\$PATH$' + line: 'export PATH={{ payara_dir }}/bin:$PATH' + regexp: '^export PATH=\/.*\/payara.*\/bin:\$PATH$' when: bashProfileResult.stat.exists is defined and bashProfileResult.stat.exists == false - name: 'Check payara package' @@ -101,7 +101,7 @@ - name: 'Check payara installation' stat: - path: /home/{{ payara_user }}/{{ payara_directory }} + path: '{{ payara_dir }}' register: installationResult - name: 'Delete contents of /home/{{ payara_user }}/unpackage' @@ -122,7 +122,7 @@ when: installationResult.stat.exists is defined and installationResult.stat.exists == false - name: 'Move contents of /home/{{ payara_user }}/unpackage' - shell: 'su -l {{ payara_user }} -c "mv /home/{{ payara_user }}/unpackage/payara* /home/{{ payara_user }}/payara{{ payara_version }}"' + shell: 'su -l {{ payara_user }} -c "mv /home/{{ payara_user }}/unpackage/payara* {{ payara_dir }}"' become: true become_user: root args: @@ -131,13 +131,13 @@ - name: 'Make sure we are using the correct java version for payara' lineinfile: - path: /home/{{ payara_user }}/{{ payara_directory }}/glassfish/config/asenv.conf + path: '{{ payara_dir }}/glassfish/config/asenv.conf' line: 'AS_JAVA="{{ java_dir }}"' regexp: '^AS_JAVA=' - name: 'Temporary fix for https://github.com/payara/Payara/issues/6344' lineinfile: - path: /home/{{ payara_user }}/{{ payara_directory }}/glassfish/config/asenv.conf + path: '{{ payara_dir }}/glassfish/config/asenv.conf' line: 'export JAVA_TOOL_OPTIONS="-Djdk.util.zip.disableZip64ExtraFieldValidation=true --add-opens=java.base/java.io=ALL-UNNAMED"' regexp: 'JAVA_TOOL_OPTIONS=' @@ -147,7 +147,7 @@ - name: 'Check payara domain' stat: - path: /home/{{ payara_user }}/{{ payara_directory }}/glassfish/domains/{{ payara_domain }}/lib + path: '{{ payara_domain_dir }}/lib' register: domainResult - name: 'Create directory for local jars' @@ -172,7 +172,7 @@ - name: 'Create symlink to mysql-connector-java.jar' file: src: /usr/local/share/java/mysql-connector-java-{{ mysql_connector_java_version }}.jar - path: /home/{{ payara_user }}/{{ payara_directory }}/glassfish/domains/{{ payara_domain }}/lib/mysql-connector-java.jar + path: '{{ payara_domain_dir }}/lib/mysql-connector-java.jar' state: link owner: '{{ payara_user }}' group: '{{ payara_user }}' @@ -197,7 +197,7 @@ - name: 'Create symlink to ojdbc8.jar' file: src: /usr/local/share/java/ojdbc8-{{ ojdbc8_jar_version }}.jar - path: /home/{{ payara_user }}/{{ payara_directory }}/glassfish/domains/{{ payara_domain }}/lib/ext/ojdbc8.jar + path: '{{ payara_domain_dir }}/lib/ext/ojdbc8.jar' state: link owner: '{{ payara_user }}' group: '{{ payara_user }}' diff --git a/roles/payara/templates/payara-init.j2 b/roles/payara/templates/payara-init.j2 index 72f11dd..c07e21c 100644 --- a/roles/payara/templates/payara-init.j2 +++ b/roles/payara/templates/payara-init.j2 @@ -12,7 +12,7 @@ # customize values for your needs NAME="{{ payara_user }}" GLASSFISH_USER=$NAME -GLASSFISH_DIR="/home/$NAME/{{ payara_directory }}" +GLASSFISH_DIR="{{ payara_dir }}" ASADMIN="$GLASSFISH_DIR/glassfish/bin/asadmin" GF_DOMAIN=$2 diff --git a/roles/payara/templates/setup.properties.j2 b/roles/payara/templates/setup.properties.j2 index 73fcd21..f7fedf8 100644 --- a/roles/payara/templates/setup.properties.j2 +++ b/roles/payara/templates/setup.properties.j2 @@ -1,7 +1,7 @@ # Glassfish secure = true container = Glassfish -home = /home/{{ payara_user }}/{{ payara_directory }} +home = {{ payara_dir }} port = 4848 # WildFly From 370fb0632979595c7375b94b0499b7101b12be59 Mon Sep 17 00:00:00 2001 From: Alan Kyffin Date: Tue, 8 Aug 2023 12:49:01 +0100 Subject: [PATCH 24/31] Update OS to Ubuntu 22.04 and check both Java 11 and 17 --- .github/workflows/ci-build.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 4d2cefd..a256eb3 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -9,7 +9,11 @@ on: jobs: run_all_roles: name: Run all ICAT Ansible roles - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 + strategy: + matrix: + java_version: [11, 17] + steps: - name: Checkout ICAT Ansible uses: actions/checkout@v2 @@ -44,5 +48,5 @@ jobs: - name: Run ICAT Ansible Playbook run: | - ansible-playbook hosts_all.yml -i hosts --vault-password-file vault_pass.txt -vv + ansible-playbook hosts_all.yml -i hosts --vault-password-file vault_pass.txt -e java_version=${{ matrix.java_version }} -vv From 4e93a1aeedb54b55be48b011f420813fdae729f7 Mon Sep 17 00:00:00 2001 From: Alan Kyffin Date: Tue, 8 Aug 2023 13:22:41 +0100 Subject: [PATCH 25/31] Run apt-get update in GitHub Actions --- .github/workflows/ci-build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index a256eb3..5228bf6 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -18,6 +18,9 @@ jobs: - name: Checkout ICAT Ansible uses: actions/checkout@v2 + - name: Run apt update + run: sudo apt-get update + - name: Install requirements run: pip install -r requirements.txt From 4a620db4a692830615d7da6ee7ae1038115e3194 Mon Sep 17 00:00:00 2001 From: Alan Kyffin Date: Tue, 8 Aug 2023 16:30:23 +0100 Subject: [PATCH 26/31] Move lxml installation from local to remote host --- .github/workflows/ci-build.yml | 4 ---- requirements.txt | 1 - roles/common/tasks/main.yml | 7 +++++++ 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 5228bf6..a6387d6 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -45,10 +45,6 @@ jobs: sudo apt-get remove --purge "mysql*" sudo rm -rf /var/lib/mysql* /etc/mysql - # Needed for `maven_artifact` module on Ansible - lxml is in requirements.txt but doesn't seem to work on GitHub Actions - - name: Install lxml - run: sudo apt-get install python3-lxml - - name: Run ICAT Ansible Playbook run: | ansible-playbook hosts_all.yml -i hosts --vault-password-file vault_pass.txt -e java_version=${{ matrix.java_version }} -vv diff --git a/requirements.txt b/requirements.txt index 8099b12..6d687ea 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1 @@ ansible==2.10.* -lxml==4.8.0 diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml index 09af7bd..569c28f 100644 --- a/roles/common/tasks/main.yml +++ b/roles/common/tasks/main.yml @@ -9,6 +9,13 @@ - vim - wget +- name: "Install python3-lxml" + package: + state: present + name: + - python3-lxml + when: not (ansible_os_family == "RedHat" and ansible_distribution_major_version == "7") + - name: "Create ansible config directory on remote hosts" file: path: /etc/ansible/facts.d From bb8be4854b66f6d392771b3e22d3a60c24f91659 Mon Sep 17 00:00:00 2001 From: Alan Kyffin Date: Tue, 8 Aug 2023 19:16:34 +0100 Subject: [PATCH 27/31] Remove compatibility for old versions of some components --- roles/authn_ldap/tasks/compat1x.yml | 25 ------------------- roles/authn_ldap/tasks/main.yml | 4 --- roles/authn_ldap/vars/main.yml | 3 --- roles/authn_simple/tasks/compat1x.yml | 25 ------------------- roles/authn_simple/tasks/main.yml | 4 --- roles/authn_simple/vars/main.yml | 3 --- roles/icat_server/tasks/compat48.yml | 25 ------------------- roles/icat_server/tasks/main.yml | 4 --- roles/icat_server/templates/run.properties.j2 | 14 ----------- .../icat_server/templates/setup.properties.j2 | 6 ----- roles/icat_server/vars/main.yml | 2 -- 11 files changed, 115 deletions(-) delete mode 100644 roles/authn_ldap/tasks/compat1x.yml delete mode 100644 roles/authn_ldap/vars/main.yml delete mode 100644 roles/authn_simple/tasks/compat1x.yml delete mode 100644 roles/authn_simple/vars/main.yml delete mode 100644 roles/icat_server/tasks/compat48.yml diff --git a/roles/authn_ldap/tasks/compat1x.yml b/roles/authn_ldap/tasks/compat1x.yml deleted file mode 100644 index 7f3da6f..0000000 --- a/roles/authn_ldap/tasks/compat1x.yml +++ /dev/null @@ -1,25 +0,0 @@ ---- - -- name: "Copy setup.properties to authn_ldap-setup.properties" - copy: - remote_src: yes - src: /home/{{ payara_user }}/install/authn.ldap/setup.properties - dest: /home/{{ payara_user }}/install/authn.ldap/authn_ldap-setup.properties - owner: "{{ payara_user }}" - group: "{{ payara_user }}" - mode: 0600 - -- name: "Copy run.properties to authn_ldap.properties" - copy: - remote_src: yes - src: /home/{{ payara_user }}/install/authn.ldap/run.properties - dest: /home/{{ payara_user }}/install/authn.ldap/authn_ldap.properties - owner: "{{ payara_user }}" - group: "{{ payara_user }}" - mode: 0644 - -- name: "Fix setup_utils.py for compatability with Payara" - replace: - path: /home/{{ payara_user }}/install/authn.ldap/setup_utils.py - regexp: 'pos = vline\.find\("\("\)' - replace: 'pos = vline.find("#")' diff --git a/roles/authn_ldap/tasks/main.yml b/roles/authn_ldap/tasks/main.yml index 7a246d7..fb172ce 100644 --- a/roles/authn_ldap/tasks/main.yml +++ b/roles/authn_ldap/tasks/main.yml @@ -104,10 +104,6 @@ notify: - "authn_ldap-handler" -- name: "Run tasks for authn_ldap versions 1.x" - import_tasks: tasks/compat1x.yml - when: authn_ldap_compat1x is defined and authn_ldap_compat1x - - name: "Setup authn_ldap if not setup or a different version is found" import_tasks: tasks/installation.yml when: (ansible_local is not defined) or (ansible_local.local is not defined) or (ansible_local.local.instantiations is not defined) or (ansible_local.local.instantiations.authn_ldap is not defined) or (ansible_local.local.instantiations.authn_ldap != 'true') or (ansible_local.local.versions.authn_ldap != authn_ldap_version) diff --git a/roles/authn_ldap/vars/main.yml b/roles/authn_ldap/vars/main.yml deleted file mode 100644 index 79d2846..0000000 --- a/roles/authn_ldap/vars/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- - -authn_ldap_compat1x: '{{ not not ( authn_ldap_version | regex_search("^1\.") ) }}' diff --git a/roles/authn_simple/tasks/compat1x.yml b/roles/authn_simple/tasks/compat1x.yml deleted file mode 100644 index 41eba4c..0000000 --- a/roles/authn_simple/tasks/compat1x.yml +++ /dev/null @@ -1,25 +0,0 @@ ---- - -- name: "Copy setup.properties to authn_simple-setup.properties" - copy: - remote_src: yes - src: /home/{{ payara_user }}/install/authn.simple/setup.properties - dest: /home/{{ payara_user }}/install/authn.simple/authn_simple-setup.properties - owner: "{{ payara_user }}" - group: "{{ payara_user }}" - mode: 0600 - -- name: "Copy run.properties to authn_simple.properties" - copy: - remote_src: yes - src: /home/{{ payara_user }}/install/authn.simple/run.properties - dest: /home/{{ payara_user }}/install/authn.simple/authn_simple.properties - owner: "{{ payara_user }}" - group: "{{ payara_user }}" - mode: 0644 - -- name: "Fix setup_utils.py for compatability with Payara" - replace: - path: /home/{{ payara_user }}/install/authn.simple/setup_utils.py - regexp: 'pos = vline\.find\("\("\)' - replace: 'pos = vline.find("#")' diff --git a/roles/authn_simple/tasks/main.yml b/roles/authn_simple/tasks/main.yml index 81cf576..1ae2efa 100644 --- a/roles/authn_simple/tasks/main.yml +++ b/roles/authn_simple/tasks/main.yml @@ -104,10 +104,6 @@ notify: - "authn_simple-handler" -- name: "Run tasks for authn_simple versions 1.x" - import_tasks: tasks/compat1x.yml - when: authn_simple_compat1x is defined and authn_simple_compat1x - - name: "Setup authn_simple if not setup or a different version is found" import_tasks: tasks/installation.yml when: (ansible_local is not defined) or (ansible_local.local is not defined) or (ansible_local.local.instantiations is not defined) or (ansible_local.local.instantiations.authn_simple is not defined) or (ansible_local.local.instantiations.authn_simple != 'true') or (ansible_local.local.versions.authn_simple != authn_simple_version) diff --git a/roles/authn_simple/vars/main.yml b/roles/authn_simple/vars/main.yml deleted file mode 100644 index 5e5f2cb..0000000 --- a/roles/authn_simple/vars/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- - -authn_simple_compat1x: '{{ not not ( authn_simple_version | regex_search("^1\.") ) }}' diff --git a/roles/icat_server/tasks/compat48.yml b/roles/icat_server/tasks/compat48.yml deleted file mode 100644 index 023ca34..0000000 --- a/roles/icat_server/tasks/compat48.yml +++ /dev/null @@ -1,25 +0,0 @@ ---- - -- name: "Copy setup.properties to icat-setup.properties" - copy: - remote_src: yes - src: /home/{{ payara_user }}/install/icat.server/setup.properties - dest: /home/{{ payara_user }}/install/icat.server/icat-setup.properties - owner: "{{ payara_user }}" - group: "{{ payara_user }}" - mode: 0600 - -- name: "Copy run.properties to icat.properties" - copy: - remote_src: yes - src: /home/{{ payara_user }}/install/icat.server/run.properties - dest: /home/{{ payara_user }}/install/icat.server/icat.properties - owner: "{{ payara_user }}" - group: "{{ payara_user }}" - mode: 0644 - -- name: "Fix setup_utils.py for compatability with Payara" - replace: - path: /home/{{ payara_user }}/install/icat.server/setup_utils.py - regexp: 'pos = vline\.find\("\("\)' - replace: 'pos = vline.find("#")' diff --git a/roles/icat_server/tasks/main.yml b/roles/icat_server/tasks/main.yml index e7c7420..17273fd 100644 --- a/roles/icat_server/tasks/main.yml +++ b/roles/icat_server/tasks/main.yml @@ -101,10 +101,6 @@ notify: - "icat_server-handler" -- name: "Run tasks for icat_server versions <= 4.8" - import_tasks: tasks/compat48.yml - when: icat_server_compat48 is defined and icat_server_compat48 - - name: "Setup icat_server if not setup or a different version is found" import_tasks: tasks/installation.yml when: (ansible_local is not defined) or (ansible_local.local is not defined) or (ansible_local.local.instantiations is not defined) or (ansible_local.local.instantiations.icat_server is not defined) or (ansible_local.local.instantiations.icat_server != 'true') or (ansible_local.local.versions.icat_server != icat_server_version) diff --git a/roles/icat_server/templates/run.properties.j2 b/roles/icat_server/templates/run.properties.j2 index 7312bc3..c7f074a 100644 --- a/roles/icat_server/templates/run.properties.j2 +++ b/roles/icat_server/templates/run.properties.j2 @@ -31,11 +31,7 @@ authn.db.admin = {{ icat_server_authn_db_admin }} {% endif %} {% if ansible_local.local.instantiations.authn_ldap is defined and ansible_local.local.instantiations.authn_ldap == 'true' %} -{% if authn_ldap_compat1x is defined and authn_ldap_compat1x %} -authn.ldap.jndi = java:global/authn.ldap-{{ authn_ldap_version }}/LDAP_Authenticator -{% else %} authn.ldap.url = https://{{ authn_ldap_url }}:8181 -{% endif %} authn.ldap.admin = {{ icat_server_authn_ldap_admin }} authn.ldap.friendly = Federal Id {% else %} @@ -45,11 +41,7 @@ authn.ldap.friendly = Federal Id {% endif %} {% if ansible_local.local.instantiations.authn_simple is defined and ansible_local.local.instantiations.authn_simple == 'true' %} -{% if authn_simple_compat1x is defined and authn_simple_compat1x %} -authn.simple.jndi = java:global/authn.simple-{{ authn_simple_version }}/SIMPLE_Authenticator -{% else %} authn.simple.url = https://{{ authn_simple_url }}:8181 -{% endif %} authn.simple.friendly = Simple {% else %} !authn.simple.url = https://localhost:8181 @@ -80,13 +72,7 @@ notification.Dataset = CU notification.Datafile = CU # Call logging setup -{% if icat_server_compat46 is defined and icat_server_compat46 %} -log.list = file table -log.file = S -log.table = S -{% else %} log.list = SESSION WRITE READ INFO -{% endif %} # Lucene {% if ansible_local.local.instantiations.icat_lucene is defined and ansible_local.local.instantiations.icat_lucene == 'true' %} diff --git a/roles/icat_server/templates/setup.properties.j2 b/roles/icat_server/templates/setup.properties.j2 index f440318..ab19e58 100644 --- a/roles/icat_server/templates/setup.properties.j2 +++ b/roles/icat_server/templates/setup.properties.j2 @@ -1,7 +1,4 @@ # Oracle -{% if icat_server_compat46 is defined and icat_server_compat46 %} -!db.vendor = oracle -{% endif %} !db.driver = oracle.jdbc.pool.OracleDataSource !db.url = jdbc:oracle:thin:@//{{ db_icat_hostname }}:{{ db_icat_oracle_port }}/{{ icat_database }} !db.username = {{ db_icat_username }} @@ -12,9 +9,6 @@ !db.logging = FINE # MySQL -{% if icat_server_compat46 is defined and icat_server_compat46 %} -db.vendor = mysql -{% endif %} db.driver = com.mysql.jdbc.jdbc2.optional.MysqlDataSource db.url = jdbc:mysql://{{ db_icat_hostname }}:{{ db_icat_mariadb_port }}/{{ icat_database }} db.username = {{ db_icat_username }} diff --git a/roles/icat_server/vars/main.yml b/roles/icat_server/vars/main.yml index 9af079e..4e675ad 100644 --- a/roles/icat_server/vars/main.yml +++ b/roles/icat_server/vars/main.yml @@ -1,6 +1,4 @@ --- -icat_server_compat46: '{{ not not ( icat_server_version | regex_search("^4\.[0-6]\.") ) }}' -icat_server_compat48: '{{ not not ( icat_server_version | regex_search("^4\.[0-8]\.") ) }}' icat_server_authn_db_admin: false icat_server_authn_ldap_admin: false From d191e42e9859455d46ec21121b6b18862a99f772 Mon Sep 17 00:00:00 2001 From: Alan Kyffin Date: Thu, 17 Aug 2023 16:26:59 +0100 Subject: [PATCH 28/31] Update Payara to 6.2023.8 --- roles/payara/defaults/main.yml | 2 +- roles/payara/tasks/main.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/payara/defaults/main.yml b/roles/payara/defaults/main.yml index 658f711..1b744a4 100644 --- a/roles/payara/defaults/main.yml +++ b/roles/payara/defaults/main.yml @@ -1,6 +1,6 @@ --- -payara_version: '6.2023.7' +payara_version: '6.2023.8' payara_dir: '/home/{{ payara_user }}/payara{{ payara_version }}' payara_domain: 'domain1' payara_domain_dir: '{{ payara_dir }}/glassfish/domains/{{ payara_domain }}' diff --git a/roles/payara/tasks/main.yml b/roles/payara/tasks/main.yml index 941129e..8d7bbfa 100644 --- a/roles/payara/tasks/main.yml +++ b/roles/payara/tasks/main.yml @@ -135,10 +135,10 @@ line: 'AS_JAVA="{{ java_dir }}"' regexp: '^AS_JAVA=' -- name: 'Temporary fix for https://github.com/payara/Payara/issues/6344' +- name: 'Temporary fix for Java 17' lineinfile: path: '{{ payara_dir }}/glassfish/config/asenv.conf' - line: 'export JAVA_TOOL_OPTIONS="-Djdk.util.zip.disableZip64ExtraFieldValidation=true --add-opens=java.base/java.io=ALL-UNNAMED"' + line: 'export JAVA_TOOL_OPTIONS="--add-opens=java.base/java.io=ALL-UNNAMED"' regexp: 'JAVA_TOOL_OPTIONS=' - name: 'Setup payara if not setup' From b63befd5a187d34365aa17fa3b9d8ce53118ab58 Mon Sep 17 00:00:00 2001 From: Alan Kyffin Date: Thu, 17 Aug 2023 17:40:08 +0100 Subject: [PATCH 29/31] Update ids.server run.properties template --- roles/ids_server/templates/run.properties.j2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/roles/ids_server/templates/run.properties.j2 b/roles/ids_server/templates/run.properties.j2 index 5f1ef0c..c3b940a 100644 --- a/roles/ids_server/templates/run.properties.j2 +++ b/roles/ids_server/templates/run.properties.j2 @@ -23,7 +23,8 @@ reader = db username {{ db_user_username }} password {{ db_user_password }} # Properties for archive storage plugin.archive.class = org.icatproject.ids.storage.ArchiveFileStorage plugin.archive.dir = /home/{{ payara_user }}/data/archive -writeDelaySeconds = 60 +delayDatasetWritesSeconds = 60 +delayDatafileOperationsSeconds = 60 startArchivingLevel1024bytes = 5000000 stopArchivingLevel1024bytes = 4000000 storageUnit = dataset From 3e8bfa198b1256d770885ab4982ae9ea4d8b92c2 Mon Sep 17 00:00:00 2001 From: Alan Kyffin Date: Thu, 7 Sep 2023 17:09:02 +0100 Subject: [PATCH 30/31] Update ojdbc8 to ojdbc11 --- roles/payara/defaults/main.yml | 4 ++-- roles/payara/tasks/main.yml | 30 ++++++++++++++++++------------ 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/roles/payara/defaults/main.yml b/roles/payara/defaults/main.yml index 1b744a4..4bad205 100644 --- a/roles/payara/defaults/main.yml +++ b/roles/payara/defaults/main.yml @@ -6,6 +6,6 @@ payara_domain: 'domain1' payara_domain_dir: '{{ payara_dir }}/glassfish/domains/{{ payara_domain }}' install_mysql_connector_java: '{{ ansible_local.local.instantiations.mariadb | default(false) }}' mysql_connector_java_version: 5.1.49 -install_ojdbc8_jar: false -ojdbc8_jar_version: 21.5.0.0 +install_ojdbc11_jar: false +ojdbc11_jar_version: 21.11.0.0 payara_user_local: false diff --git a/roles/payara/tasks/main.yml b/roles/payara/tasks/main.yml index 8d7bbfa..1b4874f 100644 --- a/roles/payara/tasks/main.yml +++ b/roles/payara/tasks/main.yml @@ -157,7 +157,7 @@ owner: root group: root mode: 0775 - when: (install_mysql_connector_java | bool) or (install_ojdbc8_jar | bool) + when: (install_mysql_connector_java | bool) or (install_ojdbc11_jar | bool) - name: 'Download mysql-connector-java.jar' get_url: @@ -181,29 +181,35 @@ when: install_mysql_connector_java | bool notify: payara-handler -- name: 'Download ojdbc8.jar' +- name: 'Download ojdbc11.jar' get_url: - url: https://repo1.maven.org/maven2/com/oracle/database/jdbc/ojdbc8/{{ ojdbc8_jar_version }}/ojdbc8-{{ ojdbc8_jar_version }}.jar - dest: /usr/local/share/java/ojdbc8-{{ ojdbc8_jar_version }}.jar + url: https://repo1.maven.org/maven2/com/oracle/database/jdbc/ojdbc11/{{ ojdbc11_jar_version }}/ojdbc11-{{ ojdbc11_jar_version }}.jar + dest: /usr/local/share/java/ojdbc11-{{ ojdbc11_jar_version }}.jar owner: root group: root mode: 0644 - when: install_ojdbc8_jar | bool + when: install_ojdbc11_jar | bool notify: payara-handler -# Path is for `lib/ext` due to https://github.com/payara/Payara/issues/4613 -# For Java 11, `java.lib.ext` has been removed so this jar won't be detected in `lib/ext` -# See https://github.com/icatproject-contrib/icat-ansible/pull/83#issuecomment-1078845685 for further details -- name: 'Create symlink to ojdbc8.jar' +- name: 'Create domain lib/ext directory' file: - src: /usr/local/share/java/ojdbc8-{{ ojdbc8_jar_version }}.jar - path: '{{ payara_domain_dir }}/lib/ext/ojdbc8.jar' + state: directory + path: '{{ payara_domain_dir }}/lib/ext' + owner: '{{ payara_user }}' + group: '{{ payara_user }}' + when: install_ojdbc11_jar | bool + notify: payara-handler + +- name: 'Create symlink to ojdbc11.jar' + file: + src: /usr/local/share/java/ojdbc11-{{ ojdbc11_jar_version }}.jar + path: '{{ payara_domain_dir }}/lib/ext/ojdbc11.jar' state: link owner: '{{ payara_user }}' group: '{{ payara_user }}' follow: no force: yes - when: install_ojdbc8_jar | bool + when: install_ojdbc11_jar | bool notify: payara-handler - meta: flush_handlers From 04b4d8bf2ea5c898d14cb9c3a9f3163e705f2718 Mon Sep 17 00:00:00 2001 From: Alan Kyffin Date: Thu, 7 Sep 2023 17:17:19 +0100 Subject: [PATCH 31/31] Update mysql-connector-j --- .../templates/mariadb.setup.properties.j2 | 2 +- roles/authn_db/templates/setup.properties.j2 | 2 +- .../templates/setup.properties.j2 | 2 +- .../templates/mariadb.setup.properties.j2 | 2 +- .../icat_server/templates/setup.properties.j2 | 2 +- roles/payara/defaults/main.yml | 4 ++-- roles/payara/tasks/main.yml | 18 +++++++++--------- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/roles/authn_db/templates/mariadb.setup.properties.j2 b/roles/authn_db/templates/mariadb.setup.properties.j2 index c11d4c4..6dfec75 100644 --- a/roles/authn_db/templates/mariadb.setup.properties.j2 +++ b/roles/authn_db/templates/mariadb.setup.properties.j2 @@ -5,7 +5,7 @@ home = {{ payara_dir }} port = 4848 # MySQL -db.driver = com.mysql.jdbc.jdbc2.optional.MysqlDataSource +db.driver = com.mysql.cj.jdbc.MysqlDataSource db.url = jdbc:mysql://{{ db_icat_hostname }}:{{ db_icat_mariadb_port }}/{{ icat_database }} db.username = {{ db_icat_username }} db.password = {{ db_icat_password }} diff --git a/roles/authn_db/templates/setup.properties.j2 b/roles/authn_db/templates/setup.properties.j2 index c11d4c4..6dfec75 100644 --- a/roles/authn_db/templates/setup.properties.j2 +++ b/roles/authn_db/templates/setup.properties.j2 @@ -5,7 +5,7 @@ home = {{ payara_dir }} port = 4848 # MySQL -db.driver = com.mysql.jdbc.jdbc2.optional.MysqlDataSource +db.driver = com.mysql.cj.jdbc.MysqlDataSource db.url = jdbc:mysql://{{ db_icat_hostname }}:{{ db_icat_mariadb_port }}/{{ icat_database }} db.username = {{ db_icat_username }} db.password = {{ db_icat_password }} diff --git a/roles/datagateway_download_api/templates/setup.properties.j2 b/roles/datagateway_download_api/templates/setup.properties.j2 index 5f7ffbb..b4b67e7 100644 --- a/roles/datagateway_download_api/templates/setup.properties.j2 +++ b/roles/datagateway_download_api/templates/setup.properties.j2 @@ -14,7 +14,7 @@ # MySQL Database db.target = mysql -db.driver = com.mysql.jdbc.jdbc2.optional.MysqlDataSource +db.driver = com.mysql.cj.jdbc.MysqlDataSource db.url = jdbc:mysql://{{ db_topcat_hostname }}:3306/{{ topcat_database }} db.username = {{ db_topcat_username }} db.password = {{ db_topcat_password }} diff --git a/roles/icat_server/templates/mariadb.setup.properties.j2 b/roles/icat_server/templates/mariadb.setup.properties.j2 index e3a4cd2..1a0767f 100644 --- a/roles/icat_server/templates/mariadb.setup.properties.j2 +++ b/roles/icat_server/templates/mariadb.setup.properties.j2 @@ -1,5 +1,5 @@ # MySQL -db.driver = com.mysql.jdbc.jdbc2.optional.MysqlDataSource +db.driver = com.mysql.cj.jdbc.MysqlDataSource db.url = jdbc:mysql://{{ db_icat_hostname }}:{{ db_icat_mariadb_port }}/{{ icat_database }} db.username = {{ db_icat_username }} db.password = {{ db_icat_password }} diff --git a/roles/icat_server/templates/setup.properties.j2 b/roles/icat_server/templates/setup.properties.j2 index ab19e58..9d8f68a 100644 --- a/roles/icat_server/templates/setup.properties.j2 +++ b/roles/icat_server/templates/setup.properties.j2 @@ -9,7 +9,7 @@ !db.logging = FINE # MySQL -db.driver = com.mysql.jdbc.jdbc2.optional.MysqlDataSource +db.driver = com.mysql.cj.jdbc.MysqlDataSource db.url = jdbc:mysql://{{ db_icat_hostname }}:{{ db_icat_mariadb_port }}/{{ icat_database }} db.username = {{ db_icat_username }} db.password = {{ db_icat_password }} diff --git a/roles/payara/defaults/main.yml b/roles/payara/defaults/main.yml index 4bad205..b84f7e8 100644 --- a/roles/payara/defaults/main.yml +++ b/roles/payara/defaults/main.yml @@ -4,8 +4,8 @@ payara_version: '6.2023.8' payara_dir: '/home/{{ payara_user }}/payara{{ payara_version }}' payara_domain: 'domain1' payara_domain_dir: '{{ payara_dir }}/glassfish/domains/{{ payara_domain }}' -install_mysql_connector_java: '{{ ansible_local.local.instantiations.mariadb | default(false) }}' -mysql_connector_java_version: 5.1.49 +install_mysql_connector_j: '{{ ansible_local.local.instantiations.mariadb | default(false) }}' +mysql_connector_j_version: 8.1.0 install_ojdbc11_jar: false ojdbc11_jar_version: 21.11.0.0 payara_user_local: false diff --git a/roles/payara/tasks/main.yml b/roles/payara/tasks/main.yml index 1b4874f..b9a3ef9 100644 --- a/roles/payara/tasks/main.yml +++ b/roles/payara/tasks/main.yml @@ -157,28 +157,28 @@ owner: root group: root mode: 0775 - when: (install_mysql_connector_java | bool) or (install_ojdbc11_jar | bool) + when: (install_mysql_connector_j | bool) or (install_ojdbc11_jar | bool) -- name: 'Download mysql-connector-java.jar' +- name: 'Download mysql-connector-j.jar' get_url: - url: https://repo1.maven.org/maven2/mysql/mysql-connector-java/{{ mysql_connector_java_version }}/mysql-connector-java-{{ mysql_connector_java_version }}.jar - dest: /usr/local/share/java/mysql-connector-java-{{ mysql_connector_java_version }}.jar + url: https://repo1.maven.org/maven2/com/mysql/mysql-connector-j/{{ mysql_connector_j_version }}/mysql-connector-j-{{ mysql_connector_j_version }}.jar + dest: /usr/local/share/java/mysql-connector-j-{{ mysql_connector_j_version }}.jar owner: root group: root mode: 0644 - when: install_mysql_connector_java | bool + when: install_mysql_connector_j | bool notify: payara-handler -- name: 'Create symlink to mysql-connector-java.jar' +- name: 'Create symlink to mysql-connector-j.jar' file: - src: /usr/local/share/java/mysql-connector-java-{{ mysql_connector_java_version }}.jar - path: '{{ payara_domain_dir }}/lib/mysql-connector-java.jar' + src: /usr/local/share/java/mysql-connector-j-{{ mysql_connector_j_version }}.jar + path: '{{ payara_domain_dir }}/lib/mysql-connector-j.jar' state: link owner: '{{ payara_user }}' group: '{{ payara_user }}' follow: no force: yes - when: install_mysql_connector_java | bool + when: install_mysql_connector_j | bool notify: payara-handler - name: 'Download ojdbc11.jar'