diff --git a/ansible/group_vars/proxy-hosts.yml b/ansible/group_vars/proxy-hosts.yml index 780546b3..b14a82cc 100644 --- a/ansible/group_vars/proxy-hosts.yml +++ b/ansible/group_vars/proxy-hosts.yml @@ -27,7 +27,7 @@ nginx_proxy_websockets_enable: True nginx_proxy_upstream_servers: - name: omeroreadonly balance: ip_hash - servers: "{{ omero_omeroreadonly_hosts }}" + servers: "{{ omero_omeroreadonly_hosts | sort }}" - name: omeroreadwrite servers: "{{ omero_omeroreadwrite_hosts }}" diff --git a/ansible/idr-omero.yml b/ansible/idr-omero.yml index c5cf50ee..a3ad133b 100644 --- a/ansible/idr-omero.yml +++ b/ansible/idr-omero.yml @@ -88,3 +88,27 @@ # Vars are in group_vars/omero-hosts.yml environment: "{{ idr_ANSIBLE_ENVIRONMENT_VARIABLES | default({}) }}" + + +# TODO: Replace with a template using +# https://github.com/openmicroscopy/openmicroscopy/pull/5387 +- hosts: "{{ idr_environment | default('idr') }}-omeroreadwrite-hosts" + + tasks: + - name: Set Nginx proxy timeout + become: yes + lineinfile: + insertafter: 'server\s*{' + path: /etc/nginx/conf.d/omero-web.conf + line: proxy_read_timeout {{ idr_omero_web_timeout }}; + regexp: proxy_read_timeout\s+.* + state: present + notify: + - restart nginx + + handlers: + - name: restart nginx + become: yes + service: + name: nginx + state: restarted