From a9884b0b314af416e921c9656066e8a74d2d1c54 Mon Sep 17 00:00:00 2001 From: khaledk2 Date: Wed, 14 Aug 2024 18:57:44 +0100 Subject: [PATCH 1/7] deploy ms-image-region --- ansible/idr-ms-image-region.yml | 23 +++++++++++++++++++++++ ansible/requirements.yml | 4 ++++ 2 files changed, 27 insertions(+) create mode 100644 ansible/idr-ms-image-region.yml diff --git a/ansible/idr-ms-image-region.yml b/ansible/idr-ms-image-region.yml new file mode 100644 index 00000000..64278463 --- /dev/null +++ b/ansible/idr-ms-image-region.yml @@ -0,0 +1,23 @@ +- hosts: "{{ idr_environment | default('idr') }}-omeroreadonly-hosts" + become: true + + tasks: + - name: get database host + set_fact: + database_server_url: >- + {{ + hostvars[groups[idr_environment | default('idr') + '-database-hosts'][0]] + ['ansible_' + (idr_net_iface | default('eth0'))]['ipv4']['address'] + }} + - name: get database password + set_fact: >- + database_user_password: "{{ idr_secret_postgresql_password_ro | default('omero') }}" + roles: + - role: ome.omero_ms_image_region + omero_ms_image_region_update_nginx: true + omero_ms_image_region_db_url: {{ datab ase_server_url }} + omero_ms_image_region_db_name: idr + omero_ms_image_region_db_username: omeroreadonly + omero_ms_image_region_db_pass: {{ database_user_password }} + omero_data_dir: /data/OMERO + omero_ms_image_region_session_id: sessionid_{{ idr_environment | default('idr') }} diff --git a/ansible/requirements.yml b/ansible/requirements.yml index b05178d6..7b36b3fa 100644 --- a/ansible/requirements.yml +++ b/ansible/requirements.yml @@ -123,6 +123,10 @@ - src: ome.versioncontrol_utils version: 1.1.0 +# this should be updated after merging the PRs and publich the role +- name: ome.omero_ms_image_region + src: https://github.com/khaledk2/ansible-role-omero-ms-image-region/ + version: new_ms_release ###################################################################### # External IDR roles From 15052eb71ef63a6f3429c82131dce62d925f1dd5 Mon Sep 17 00:00:00 2001 From: khaledk2 Date: Wed, 14 Aug 2024 19:02:44 +0100 Subject: [PATCH 2/7] use pre_tasks --- ansible/idr-ms-image-region.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/idr-ms-image-region.yml b/ansible/idr-ms-image-region.yml index 64278463..814a4250 100644 --- a/ansible/idr-ms-image-region.yml +++ b/ansible/idr-ms-image-region.yml @@ -1,7 +1,7 @@ - hosts: "{{ idr_environment | default('idr') }}-omeroreadonly-hosts" become: true - tasks: + pre_tasks: - name: get database host set_fact: database_server_url: >- From 45693d78477d0f73fde5256808b2c3a52a2ceb5f Mon Sep 17 00:00:00 2001 From: khaledk2 Date: Sun, 25 Aug 2024 21:13:14 +0100 Subject: [PATCH 3/7] move ms deployment to omero read only --- ansible/group_vars/omeroreadonly-hosts.yml | 10 ++++++++++ ansible/idr-ms-image-region.yml | 23 ---------------------- ansible/idr-omero-readonly.yml | 12 +++++++++++ 3 files changed, 22 insertions(+), 23 deletions(-) delete mode 100644 ansible/idr-ms-image-region.yml diff --git a/ansible/group_vars/omeroreadonly-hosts.yml b/ansible/group_vars/omeroreadonly-hosts.yml index 4e006893..d4e23859 100644 --- a/ansible/group_vars/omeroreadonly-hosts.yml +++ b/ansible/group_vars/omeroreadonly-hosts.yml @@ -11,3 +11,13 @@ idr_omero_web_user_dropdown: false # Set this to 'ro' to mount /data/BioFormatsCache on read-only servers as # read-only, default is 'rw' # idr_bioformatscache_readwrite: + +# MS variables + +omero_ms_image_region_update_nginx: true +omero_ms_image_region_db_url: {{ omero_db_host_ansible }} +omero_ms_image_region_db_name: idr +omero_ms_image_region_db_username: omeroreadonly +omero_ms_image_region_db_pass: {{ omero_server_dbpassword }} +omero_data_dir: /data/OMERO +omero_ms_image_region_session_id: sessionid_{{ idr_environment | default('idr') }} diff --git a/ansible/idr-ms-image-region.yml b/ansible/idr-ms-image-region.yml deleted file mode 100644 index 814a4250..00000000 --- a/ansible/idr-ms-image-region.yml +++ /dev/null @@ -1,23 +0,0 @@ -- hosts: "{{ idr_environment | default('idr') }}-omeroreadonly-hosts" - become: true - - pre_tasks: - - name: get database host - set_fact: - database_server_url: >- - {{ - hostvars[groups[idr_environment | default('idr') + '-database-hosts'][0]] - ['ansible_' + (idr_net_iface | default('eth0'))]['ipv4']['address'] - }} - - name: get database password - set_fact: >- - database_user_password: "{{ idr_secret_postgresql_password_ro | default('omero') }}" - roles: - - role: ome.omero_ms_image_region - omero_ms_image_region_update_nginx: true - omero_ms_image_region_db_url: {{ datab ase_server_url }} - omero_ms_image_region_db_name: idr - omero_ms_image_region_db_username: omeroreadonly - omero_ms_image_region_db_pass: {{ database_user_password }} - omero_data_dir: /data/OMERO - omero_ms_image_region_session_id: sessionid_{{ idr_environment | default('idr') }} diff --git a/ansible/idr-omero-readonly.yml b/ansible/idr-omero-readonly.yml index fa5ef299..a657e922 100644 --- a/ansible/idr-omero-readonly.yml +++ b/ansible/idr-omero-readonly.yml @@ -229,3 +229,15 @@ path: "{{ omero_common_basedir }}/server/OMERO.server/lib/scripts/omero" state: absent notify: restart omero-server + +# deploy ms +# This will modify the omero web nginx configuration file +# It should be executed after running idr-omero-web.yml +# as it is in idr-01-install-idr.yml +- hosts: "{{ idr_environment | default('idr') }}-omeroreadonly-hosts" + become: true + + roles: + - role: ome.omero_ms_image_region + + environment: "{{ idr_ANSIBLE_ENVIRONMENT_VARIABLES | default({}) }}" From eb89e4727871915c11b3ae2c7bf7fed97f0f6569 Mon Sep 17 00:00:00 2001 From: khaledk2 Date: Mon, 26 Aug 2024 09:19:07 +0100 Subject: [PATCH 4/7] fix syntex issue --- ansible/group_vars/omeroreadonly-hosts.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ansible/group_vars/omeroreadonly-hosts.yml b/ansible/group_vars/omeroreadonly-hosts.yml index d4e23859..4dc7e591 100644 --- a/ansible/group_vars/omeroreadonly-hosts.yml +++ b/ansible/group_vars/omeroreadonly-hosts.yml @@ -15,9 +15,9 @@ idr_omero_web_user_dropdown: false # MS variables omero_ms_image_region_update_nginx: true -omero_ms_image_region_db_url: {{ omero_db_host_ansible }} +omero_ms_image_region_db_url: "{{ omero_db_host_ansible }}" omero_ms_image_region_db_name: idr omero_ms_image_region_db_username: omeroreadonly -omero_ms_image_region_db_pass: {{ omero_server_dbpassword }} +omero_ms_image_region_db_pass: "{{ omero_server_dbpassword }}" omero_data_dir: /data/OMERO -omero_ms_image_region_session_id: sessionid_{{ idr_environment | default('idr') }} +omero_ms_image_region_session_id: "sessionid_{{ idr_environment | default('idr') }}" From 832d695763b6529f35c50f19f303c09f60288d1c Mon Sep 17 00:00:00 2001 From: khaledk2 Date: Mon, 26 Aug 2024 11:31:59 +0100 Subject: [PATCH 5/7] use branch for ome.analysis_tools role --- ansible/requirements.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ansible/requirements.yml b/ansible/requirements.yml index 7b36b3fa..8b4d80b8 100644 --- a/ansible/requirements.yml +++ b/ansible/requirements.yml @@ -6,8 +6,10 @@ # TODO: check ordering of these dependencies to ensure nested dependencies # are managed by this file and not the role -- src: ome.analysis_tools - version: 1.1.0 +- name: ome.analysis_tools + src: https://github.com/khaledk2/ansible-role-analysis-tools/ + version: fix_package_download_url + - name: ome.anonymous_ftp version: 0.2.1 @@ -128,6 +130,7 @@ src: https://github.com/khaledk2/ansible-role-omero-ms-image-region/ version: new_ms_release + ###################################################################### # External IDR roles From bb0a48f0f223a400463890fd0186ae0946c15671 Mon Sep 17 00:00:00 2001 From: khaledk2 Date: Wed, 4 Sep 2024 14:35:00 +0100 Subject: [PATCH 6/7] add restart ms service --- ansible/idr-09-monitoring.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ansible/idr-09-monitoring.yml b/ansible/idr-09-monitoring.yml index e0681269..a11178db 100644 --- a/ansible/idr-09-monitoring.yml +++ b/ansible/idr-09-monitoring.yml @@ -5,3 +5,12 @@ - import_playbook: management-prometheus.yml - import_playbook: management-grafana.yml - import_playbook: management-fluentd.yml + +- hosts: "{{ idr_environment | default('idr') }}-omeroreadonly-hosts" + Tasks: + name: restart the ms service + become: true + ansible.builtin.service: + state: restarted + daemon_reload: true + name: omero-ms-image-region.service From 59dbd8824cd6a1a8cd6381a0eb63eb7b32c1d183 Mon Sep 17 00:00:00 2001 From: khaledk2 Date: Thu, 5 Sep 2024 17:36:48 +0100 Subject: [PATCH 7/7] use ms_image_region and analysis_tools roles from Ansible Galaxy --- ansible/requirements.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/ansible/requirements.yml b/ansible/requirements.yml index 8b4d80b8..bb51bb01 100644 --- a/ansible/requirements.yml +++ b/ansible/requirements.yml @@ -7,9 +7,7 @@ # are managed by this file and not the role - name: ome.analysis_tools - src: https://github.com/khaledk2/ansible-role-analysis-tools/ - version: fix_package_download_url - + version: 1.1.1 - name: ome.anonymous_ftp version: 0.2.1 @@ -125,11 +123,8 @@ - src: ome.versioncontrol_utils version: 1.1.0 -# this should be updated after merging the PRs and publich the role - name: ome.omero_ms_image_region - src: https://github.com/khaledk2/ansible-role-omero-ms-image-region/ - version: new_ms_release - + version: 1.0.0 ###################################################################### # External IDR roles