diff --git a/.config/ansible-lint.yml b/.config/ansible-lint.yml new file mode 100644 index 00000000..59c89da2 --- /dev/null +++ b/.config/ansible-lint.yml @@ -0,0 +1,5 @@ +# .config/ansible-lint.yml +warn_list: # or 'skip_list' to silence them completely + - experimental # all rules tagged as experimental + - latest[git] # Result of the command may vary on subsequent runs. + - no-changed-when # Commands should not change things if nothing needs doing. diff --git a/.github/workflows/molecule.yml b/.github/workflows/molecule.yml index ed5a7b62..a422025a 100644 --- a/.github/workflows/molecule.yml +++ b/.github/workflows/molecule.yml @@ -8,11 +8,11 @@ on: jobs: list-scenarios: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 outputs: matrix: ${{ steps.listscenarios.outputs.scenarios }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - id: listscenarios uses: ome/action-ansible-molecule-list-scenarios@main @@ -20,14 +20,22 @@ jobs: name: Test needs: - list-scenarios - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 strategy: # Keep running so we can see if other tests pass fail-fast: false matrix: scenario: ${{fromJson(needs.list-scenarios.outputs.matrix)}} steps: - - uses: actions/checkout@v2 - - uses: ome/action-ome-ansible-molecule@main + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 with: - scenario: ${{ matrix.scenario }} + python-version: '3.8' + - name: Install Ansible & Molecule + run: | + pip install "ansible<8" "ansible-lint<6.13" flake8 + pip install "molecule<5" "ansible-compat<4" + pip install molecule-plugins[docker] pytest-testinfra + pip3.8 install jmespath + - name: Run molecule + run: molecule test -s "${{ matrix.scenario }}" diff --git a/bootstrap/playbook.yml b/bootstrap/playbook.yml index acf7301d..1dc43c86 100644 --- a/bootstrap/playbook.yml +++ b/bootstrap/playbook.yml @@ -1,34 +1,36 @@ --- -# Playbook which runs the necessary root-level steps so that a host can be managed by others -- hosts: omedev +# Playbook which runs the necessary root-level steps +# so that a host can be managed by others +- name: Boot1 + hosts: omedev roles: - - role: ome.network + - role: ome.network - - role: ome.lvm_partition - lvm_lvname: var_log - lvm_lvmount: /var/log - lvm_lvsize: 4g - lvm_lvfilesystem: xfs - lvm_vgname: VolGroup00 - - role: ome.lvm_partition - lvm_lvname: root - lvm_lvmount: / - lvm_lvsize: 100%FREE - lvm_lvfilesystem: xfs - lvm_vgname: VolGroup00 - lvm_shrink: False + - role: ome.lvm_partition + lvm_lvname: var_log + lvm_lvmount: /var/log + lvm_lvsize: 4g + lvm_lvfilesystem: xfs + lvm_vgname: VolGroup00 + - role: ome.lvm_partition + lvm_lvname: root + lvm_lvmount: / + lvm_lvsize: 100%FREE + lvm_lvfilesystem: xfs + lvm_vgname: VolGroup00 + lvm_shrink: false - - role: ome.sudoers - sudoers_individual_commands: - - user: "%omedev" - become: ALL - command: "NOPASSWD: ALL" + - role: ome.sudoers + sudoers_individual_commands: + - user: "%omedev" + become: ALL + command: "NOPASSWD: ALL" - - role: ome.upgrade_distpackages - upgrade_distpackages_reboot_kernel: True + - role: ome.upgrade_distpackages + upgrade_distpackages_reboot_kernel: true - -- hosts: vlan-10ge-servers, vlan-ome-idr-docker +- name: Network + hosts: vlan-10ge-servers, vlan-ome-idr-docker roles: - - role: ome.network + - role: ome.network diff --git a/k8s/bootstrap/playbook.yml b/k8s/bootstrap/playbook.yml index 37c415b8..c31b457f 100644 --- a/k8s/bootstrap/playbook.yml +++ b/k8s/bootstrap/playbook.yml @@ -1,4 +1,5 @@ --- -- hosts: vlan-10ge-servers +- name: Bootkub + hosts: vlan-10ge-servers roles: - - role: ome.network + - role: ome.network diff --git a/k8s/prerequisites/playbook.yml b/k8s/prerequisites/playbook.yml index 972b0747..9eec5c17 100644 --- a/k8s/prerequisites/playbook.yml +++ b/k8s/prerequisites/playbook.yml @@ -1,5 +1,6 @@ --- -- hosts: kubernetes-lochy-k8s +- name: Kuberneteslochy + hosts: kubernetes-lochy-k8s roles: # No mounts are configured, this just installs required packages - - role: ome.nfs_mount + - role: ome.nfs_mount diff --git a/molecule/bootstrap/molecule.yml b/molecule/bootstrap/molecule.yml index 918cb0c5..359f74fe 100644 --- a/molecule/bootstrap/molecule.yml +++ b/molecule/bootstrap/molecule.yml @@ -5,10 +5,10 @@ dependency: role-file: requirements.yml driver: name: docker -lint: - name: yamllint - # TODO: enable - enabled: False +lint: | + yamllint . + ansible-lint + flake8 platforms: - name: omedev image: centos:7 @@ -26,5 +26,3 @@ scenario: - syntax verifier: name: testinfra - lint: - name: flake8 diff --git a/molecule/docker-prod/Dockerfile.j2 b/molecule/docker-prod/Dockerfile.j2 deleted file mode 120000 index 0e9184b4..00000000 --- a/molecule/docker-prod/Dockerfile.j2 +++ /dev/null @@ -1 +0,0 @@ -../resources/Dockerfile.j2 \ No newline at end of file diff --git a/molecule/docker-prod/Dockerfile.j2 b/molecule/docker-prod/Dockerfile.j2 new file mode 100644 index 00000000..7e2d467d --- /dev/null +++ b/molecule/docker-prod/Dockerfile.j2 @@ -0,0 +1,22 @@ +# Molecule managed + +{% if item.registry is defined %} +FROM {{ item.registry.url }}/{{ item.image }} +{% else %} +FROM {{ item.image }} +{% endif %} + +{% if item.env is defined %} +{% for var, value in item.env.items() %} +{% if value %} +ENV {{ var }} {{ value }} +{% endif %} +{% endfor %} +{% endif %} + +RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python sudo python-jmespath bash ca-certificates iproute2 && apt-get clean; \ + elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python sudo python-devel python*-dnf bash iproute && dnf clean all; \ + elif [ $(command -v yum) ]; then yum makecache fast && yum install -y python sudo python36-jmespath python38-jmespath yum-plugin-ovl bash iproute ca-certificates && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \ + elif [ $(command -v zypper) ]; then zypper refresh && zypper install -y python sudo bash python-xml iproute2 && zypper clean -a; \ + elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates; \ + elif [ $(command -v xbps-install) ]; then xbps-install -Syu && xbps-install -y python sudo bash ca-certificates iproute2 && xbps-remove -O; fi diff --git a/molecule/docker-prod/converge.yml b/molecule/docker-prod/converge.yml index 60bc873f..775d3456 100644 --- a/molecule/docker-prod/converge.yml +++ b/molecule/docker-prod/converge.yml @@ -15,5 +15,5 @@ set_fact: redmine_tracker_db_host: "{{ hostname_ip.stdout }}" - -- import_playbook: ../../omedev/docker-prod-apps.yml +- name: Import-playbook + import_playbook: ../../omedev/docker-prod-apps.yml diff --git a/molecule/docker-prod/molecule.yml b/molecule/docker-prod/molecule.yml index 4434834c..f43e3aa3 100644 --- a/molecule/docker-prod/molecule.yml +++ b/molecule/docker-prod/molecule.yml @@ -5,10 +5,10 @@ dependency: role-file: requirements.yml driver: name: docker -lint: - name: yamllint - # TODO: enable - enabled: False +lint: | + yamllint . + ansible-lint + flake8 platforms: - name: ome-dockr-prod1.openmicroscopy.org image: centos/systemd:latest @@ -41,7 +41,7 @@ provisioner: group_vars: # all: - # molecule_test: True + # molecule_test: true docker-hosts: # This should allow docker-in-docker to work docker_storage_driver: vfs @@ -54,5 +54,3 @@ scenario: name: docker-prod verifier: name: testinfra - lint: - name: flake8 diff --git a/molecule/docker-prod/prepare.yml b/molecule/docker-prod/prepare.yml index 2592df82..7bb8ba41 100644 --- a/molecule/docker-prod/prepare.yml +++ b/molecule/docker-prod/prepare.yml @@ -3,7 +3,7 @@ hosts: ome-dockr-prod1.openmicroscopy.org roles: - role: ome.postgresql - postgresql_version: "12" + postgresql_version: "13" postgresql_server_auth: - database: redmine user: redmine @@ -18,4 +18,5 @@ - redmine postgresql_server_listen: "'*'" -- import_playbook: ../../omedev/playbook.yml +- name: Import playbook + import_playbook: ../../omedev/playbook.yml diff --git a/molecule/nightshade-webclients/Dockerfile.j2 b/molecule/nightshade-webclients/Dockerfile.j2 deleted file mode 120000 index 0e9184b4..00000000 --- a/molecule/nightshade-webclients/Dockerfile.j2 +++ /dev/null @@ -1 +0,0 @@ -../resources/Dockerfile.j2 \ No newline at end of file diff --git a/molecule/nightshade-webclients/molecule.yml b/molecule/nightshade-webclients/molecule.yml index 87112b6a..71cd0c18 100644 --- a/molecule/nightshade-webclients/molecule.yml +++ b/molecule/nightshade-webclients/molecule.yml @@ -5,10 +5,10 @@ dependency: role-file: requirements.yml driver: name: docker -lint: - name: yamllint - # TODO: enable - enabled: False +lint: | + yamllint . + ansible-lint + flake8 platforms: - name: ns-webclients image: centos/systemd @@ -28,7 +28,7 @@ provisioner: molecule_test: true docker-hosts: # firewalld isn't installed, don't attempt to disable - iptables_raw_disable_firewalld: False + iptables_raw_disable_firewalld: false playbooks: converge: ../../site.yml lint: @@ -56,5 +56,3 @@ scenario: - destroy verifier: name: testinfra - lint: - name: flake8 diff --git a/molecule/ome-demoserver/molecule.yml b/molecule/ome-demoserver/molecule.yml index 3c926349..3e399874 100644 --- a/molecule/ome-demoserver/molecule.yml +++ b/molecule/ome-demoserver/molecule.yml @@ -5,10 +5,10 @@ dependency: role-file: requirements.yml driver: name: docker -lint: - name: yamllint - # TODO: enable - enabled: False +lint: | + yamllint . + ansible-lint + flake8 platforms: - name: ome-demoserver image: centos:7 @@ -31,5 +31,3 @@ scenario: - syntax verifier: name: testinfra - lint: - name: flake8 diff --git a/molecule/ome-dundeeomero/Dockerfile.j2 b/molecule/ome-dundeeomero/Dockerfile.j2 deleted file mode 120000 index 0e9184b4..00000000 --- a/molecule/ome-dundeeomero/Dockerfile.j2 +++ /dev/null @@ -1 +0,0 @@ -../resources/Dockerfile.j2 \ No newline at end of file diff --git a/molecule/ome-dundeeomero/Dockerfile.j2 b/molecule/ome-dundeeomero/Dockerfile.j2 new file mode 100644 index 00000000..00b7fd61 --- /dev/null +++ b/molecule/ome-dundeeomero/Dockerfile.j2 @@ -0,0 +1,22 @@ +# Molecule managed + +{% if item.registry is defined %} +FROM {{ item.registry.url }}/{{ item.image }} +{% else %} +FROM {{ item.image }} +{% endif %} + +{% if item.env is defined %} +{% for var, value in item.env.items() %} +{% if value %} +ENV {{ var }} {{ value }} +{% endif %} +{% endfor %} +{% endif %} + +RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python sudo bash ca-certificates iproute2 && apt-get clean; \ + elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python sudo python-devel python*-dnf bash iproute && dnf clean all; \ + elif [ $(command -v yum) ]; then yum makecache fast && yum install -y python sudo yum-plugin-ovl bash iproute ca-certificates && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \ + elif [ $(command -v zypper) ]; then zypper refresh && zypper install -y python sudo bash python-xml iproute2 && zypper clean -a; \ + elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates; \ + elif [ $(command -v xbps-install) ]; then xbps-install -Syu && xbps-install -y python sudo bash ca-certificates iproute2 && xbps-remove -O; fi diff --git a/molecule/ome-dundeeomero/molecule.yml b/molecule/ome-dundeeomero/molecule.yml index 1f4289f1..8260f968 100644 --- a/molecule/ome-dundeeomero/molecule.yml +++ b/molecule/ome-dundeeomero/molecule.yml @@ -5,10 +5,10 @@ dependency: role-file: requirements.yml driver: name: docker -lint: - name: yamllint - # TODO: enable - enabled: False +lint: | + yamllint . + ansible-lint + flake8 platforms: - name: ome-dundeeomero.openmicroscopy.org image: centos/systemd @@ -22,15 +22,15 @@ provisioner: name: ansible options: diff: true - skip-tags: - - skip_molecule + # skip-tags: + # - "skip_molecule" inventory: group_vars: all: molecule_test: true docker-hosts: # firewalld isn't installed, don't attempt to disable - iptables_raw_disable_firewalld: False + iptables_raw_disable_firewalld: false playbooks: converge: ../../site.yml lint: @@ -57,5 +57,3 @@ scenario: - destroy verifier: name: testinfra - lint: - name: flake8 diff --git a/molecule/ome-pg-prod/Dockerfile.j2 b/molecule/ome-pg-prod/Dockerfile.j2 deleted file mode 120000 index 0e9184b4..00000000 --- a/molecule/ome-pg-prod/Dockerfile.j2 +++ /dev/null @@ -1 +0,0 @@ -../resources/Dockerfile.j2 \ No newline at end of file diff --git a/molecule/ome-pg-prod/molecule_disabled.yml b/molecule/ome-pg-prod/molecule_disabled.yml index 3788bbb9..b2feddfb 100644 --- a/molecule/ome-pg-prod/molecule_disabled.yml +++ b/molecule/ome-pg-prod/molecule_disabled.yml @@ -5,10 +5,10 @@ dependency: role-file: requirements.yml driver: name: docker -lint: - name: yamllint - # TODO: enable - enabled: False +lint: | + yamllint . + ansible-lint + flake8 platforms: - name: ome-pg-prod1.openmicroscopy.org image: centos/systemd @@ -26,5 +26,3 @@ scenario: name: ome-pg-prod verifier: name: testinfra - lint: - name: flake8 diff --git a/molecule/ome-pg-prod/prepare.yml b/molecule/ome-pg-prod/prepare.yml index ddd75f7d..04a5e83f 100644 --- a/molecule/ome-pg-prod/prepare.yml +++ b/molecule/ome-pg-prod/prepare.yml @@ -1,8 +1,9 @@ # Workaround lack of cron on Docker -- hosts: ome-pg-prod1.openmicroscopy.org +- name: Prepare pg prod + hosts: ome-pg-prod1.openmicroscopy.org tasks: - - name: Install cron - become: yes - yum: + - name: Install cron + become: true + ansible.builtin.yum: name: cronie state: present diff --git a/molecule/omero-training-server/Dockerfile.j2 b/molecule/omero-training-server/Dockerfile.j2 deleted file mode 120000 index 0e9184b4..00000000 --- a/molecule/omero-training-server/Dockerfile.j2 +++ /dev/null @@ -1 +0,0 @@ -../resources/Dockerfile.j2 \ No newline at end of file diff --git a/molecule/omero-training-server/Dockerfile.j2 b/molecule/omero-training-server/Dockerfile.j2 new file mode 100644 index 00000000..00b7fd61 --- /dev/null +++ b/molecule/omero-training-server/Dockerfile.j2 @@ -0,0 +1,22 @@ +# Molecule managed + +{% if item.registry is defined %} +FROM {{ item.registry.url }}/{{ item.image }} +{% else %} +FROM {{ item.image }} +{% endif %} + +{% if item.env is defined %} +{% for var, value in item.env.items() %} +{% if value %} +ENV {{ var }} {{ value }} +{% endif %} +{% endfor %} +{% endif %} + +RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python sudo bash ca-certificates iproute2 && apt-get clean; \ + elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python sudo python-devel python*-dnf bash iproute && dnf clean all; \ + elif [ $(command -v yum) ]; then yum makecache fast && yum install -y python sudo yum-plugin-ovl bash iproute ca-certificates && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \ + elif [ $(command -v zypper) ]; then zypper refresh && zypper install -y python sudo bash python-xml iproute2 && zypper clean -a; \ + elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates; \ + elif [ $(command -v xbps-install) ]; then xbps-install -Syu && xbps-install -y python sudo bash ca-certificates iproute2 && xbps-remove -O; fi diff --git a/molecule/omero-training-server/molecule.yml b/molecule/omero-training-server/molecule.yml index be7d2fee..af145c55 100644 --- a/molecule/omero-training-server/molecule.yml +++ b/molecule/omero-training-server/molecule.yml @@ -5,10 +5,10 @@ dependency: role-file: requirements.yml driver: name: docker -lint: - name: yamllint - # TODO: enable - enabled: False +lint: | + yamllint . + ansible-lint + flake8 platforms: - name: ome-outreach image: centos/systemd @@ -24,8 +24,8 @@ provisioner: inventory: group_vars: all: - molecule_test: True - postgresql_version: "9.6" + molecule_test: true + postgresql_version: "13" docker-hosts: # This should allow docker-in-docker to work docker_storage_driver: vfs @@ -33,7 +33,7 @@ provisioner: # testing on travis: https://github.com/docker/for-linux/issues/219 docker_version: 17.09.1.ce-1.el7.centos # firewalld isn't installed, don't attempt to disable - iptables_raw_disable_firewalld: False + iptables_raw_disable_firewalld: false playbooks: prepare: ../resources/prepare-iproute.yml converge: ../../site.yml @@ -52,10 +52,8 @@ scenario: - prepare - converge # FIXME: Some tasks are not idempotent - #- idempotence + # - idempotence - verify - destroy verifier: name: testinfra - lint: - name: flake8 diff --git a/molecule/release/Dockerfile.j2 b/molecule/release/Dockerfile.j2 deleted file mode 120000 index 0e9184b4..00000000 --- a/molecule/release/Dockerfile.j2 +++ /dev/null @@ -1 +0,0 @@ -../resources/Dockerfile.j2 \ No newline at end of file diff --git a/molecule/release/molecule.yml b/molecule/release/molecule.yml index 2fd3f560..add768eb 100644 --- a/molecule/release/molecule.yml +++ b/molecule/release/molecule.yml @@ -3,10 +3,10 @@ dependency: name: galaxy driver: name: docker -lint: - name: yamllint - # TODO: enable - enabled: False +lint: | + yamllint . + ansible-lint + flake8 platforms: - name: release image: centos:7 @@ -35,5 +35,3 @@ scenario: name: release verifier: name: testinfra - lint: - name: flake8 diff --git a/molecule/release/prepare.yml b/molecule/release/prepare.yml index d7575466..7f4743fd 100644 --- a/molecule/release/prepare.yml +++ b/molecule/release/prepare.yml @@ -1,5 +1,6 @@ --- -- hosts: all +- name: Prepare release + hosts: all vars: www_folders: - /uod/idr/www/docs.openmicroscopy.org @@ -8,64 +9,64 @@ - 3.2.0 - 3.2.0-rc1 tasks: - - name: Create existing released components - file: - path: "{{ item }}/component/3.1.8" - state: directory - owner: root - group: root - mode: 01555 - with_items: "{{ www_folders }}" - - name: Create minor version directory - file: - path: "{{ item }}/component/3.1" - state: directory - with_items: "{{ www_folders }}" - - name: Create minor version redirects - copy: - dest: "{{ item }}/component/3.1/.htaccess" - content: "Redirect 301 /component/3.1 /component/3.1.8" - with_items: "{{ www_folders }}" - - name: Create major version directory - file: - path: "{{ item }}/component/3" - state: directory - with_items: "{{ www_folders }}" - - name: Create major version redirects - copy: - dest: "{{ item }}/component/3/.htaccess" - content: "Redirect 301 /component/3 /component/3.1.8" - with_items: "{{ www_folders }}" - - name: Create latest version directory - file: - path: "{{ item }}/component/latest" - state: directory - with_items: "{{ www_folders }}" - - name: Create latest version redirects - copy: - dest: "{{ item }}/component/latest/.htaccess" - content: "Redirect 301 /component/latest /component/3.1.8" - with_items: "{{ www_folders }}" - - name: Create new release components - file: - path: "{{ item[0] }}/component/{{ item[1] }}" - state: directory - mode: 01777 - with_nested: - - "{{ www_folders }}" - - "{{ releases }}" - - name: Create .htaccess file - file: - path: "{{ item[0] }}/component/{{ item[1] }}/.htaccess" - state: touch - with_nested: - - "{{ www_folders }}" - - "{{ releases }}" - - name: Create mock content - file: - path: "{{ item[0] }}/component/{{ item[1] }}/test" - state: touch - mode: 01777 - with_nested: - - "{{ www_folders }}" - - "{{ releases }}" + - name: Create existing released components + ansible.builtin.file: + path: "{{ item }}/component/3.1.8" + state: directory + owner: root + group: root + mode: 01555 + with_items: "{{ www_folders }}" + - name: Create minor version directory + ansible.builtin.file: + path: "{{ item }}/component/3.1" + state: directory + with_items: "{{ www_folders }}" + - name: Create minor version redirects + ansible.builtin.copy: + dest: "{{ item }}/component/3.1/.htaccess" + content: "Redirect 301 /component/3.1 /component/3.1.8" + with_items: "{{ www_folders }}" + - name: Create major version directory + ansible.builtin.file: + path: "{{ item }}/component/3" + state: directory + with_items: "{{ www_folders }}" + - name: Create major version redirects + ansible.builtin.copy: + dest: "{{ item }}/component/3/.htaccess" + content: "Redirect 301 /component/3 /component/3.1.8" + with_items: "{{ www_folders }}" + - name: Create latest version directory + ansible.builtin.file: + path: "{{ item }}/component/latest" + state: directory + with_items: "{{ www_folders }}" + - name: Create latest version redirects + ansible.builtin.copy: + dest: "{{ item }}/component/latest/.htaccess" + content: "Redirect 301 /component/latest /component/3.1.8" + with_items: "{{ www_folders }}" + - name: Create new release components + ansible.builtin.file: + path: "{{ item[0] }}/component/{{ item[1] }}" + state: directory + mode: 01777 + with_nested: + - "{{ www_folders }}" + - "{{ releases }}" + - name: Create .htaccess file + ansible.builtin.file: + path: "{{ item[0] }}/component/{{ item[1] }}/.htaccess" + state: touch + with_nested: + - "{{ www_folders }}" + - "{{ releases }}" + - name: Create mock content + ansible.builtin.file: + path: "{{ item[0] }}/component/{{ item[1] }}/test" + state: touch + mode: 01777 + with_nested: + - "{{ www_folders }}" + - "{{ releases }}" diff --git a/molecule/resources/prepare-iproute.yml b/molecule/resources/prepare-iproute.yml index d352bcc5..1730ad08 100644 --- a/molecule/resources/prepare-iproute.yml +++ b/molecule/resources/prepare-iproute.yml @@ -1,14 +1,15 @@ # Install iproute for ansible network vars -- hosts: all +- name: Prepare iproute in resources + hosts: all tasks: - - name: Install iproute - become: yes - yum: + - name: Install iproute + become: true + ansible.builtin.yum: name: iproute state: present - - name: Install cron - become: true - yum: + - name: Install cron + become: true + ansible.builtin.yum: name: cronie state: present diff --git a/molecule/web-proxy/molecule.yml b/molecule/web-proxy/molecule.yml index 07b70dea..8bdf86d9 100644 --- a/molecule/web-proxy/molecule.yml +++ b/molecule/web-proxy/molecule.yml @@ -5,10 +5,10 @@ dependency: role-file: requirements.yml driver: name: docker -lint: - name: yamllint - # TODO: enable - enabled: False +lint: | + yamllint . + ansible-lint + flake8 platforms: - name: web-proxy image: centos:7 @@ -28,5 +28,3 @@ scenario: - syntax verifier: name: testinfra - lint: - name: flake8 diff --git a/molecule/www/molecule.yml b/molecule/www/molecule.yml index 1d310045..e6b232df 100644 --- a/molecule/www/molecule.yml +++ b/molecule/www/molecule.yml @@ -5,10 +5,10 @@ dependency: role-file: requirements.yml driver: name: docker -lint: - name: yamllint - # TODO: enable - enabled: False +lint: | + yamllint . + ansible-lint + flake8 platforms: - name: www image: centos/systemd @@ -25,5 +25,3 @@ scenario: name: www verifier: name: testinfra - lint: - name: flake8 diff --git a/omedev/playbook.yml b/omedev/playbook.yml index 03ecc5b2..744030a3 100644 --- a/omedev/playbook.yml +++ b/omedev/playbook.yml @@ -1,7 +1,7 @@ --- # OMEDEV servers - -- hosts: omedev-docker +- name: Ome dev + hosts: omedev-docker roles: @@ -10,6 +10,7 @@ - role: ome.versioncontrol_utils - role: ome.nfs_mount - # This will only have effect if nfs_share_mounts is defined in host/group vars + # This will only have effect if nfs_share_mounts + # is defined in host/group vars - role: ome.docker diff --git a/omero/learning.yml b/omero/learning.yml index 0495c85a..a5f268b6 100644 --- a/omero/learning.yml +++ b/omero/learning.yml @@ -6,11 +6,15 @@ # - Migrate database with pg_dump, pg_restore. # - Upgrade database. # Do run shape_color_argb_to_rgba.sql. -# UPDATE shape SET points = REGEXP_REPLACE(REGEXP_REPLACE(points, '[^\[]*\[([^\]]*).*', '\1'), ', ', ' ', 'g') WHERE discriminator = 'polygon' AND points LIKE 'points[%'; +# UPDATE shape SET points = +# REGEXP_REPLACE(REGEXP_REPLACE(points, '[^\[]*\[([^\]]*).*', +# '\1'), ', ', ' ', 'g') WHERE discriminator = 'polygon' AND points +# LIKE 'points[%'; # - bin/omero db password for root and public users. # - systemctl start omero-{server,web} -- hosts: omero-learning +- name: Learning Virtual Microscope playbook + hosts: omero-learning roles: - role: ome.lvm_partition lvm_vgname: VolGroup00 @@ -18,7 +22,7 @@ lvm_lvmount: '/var/lib/pgsql' lvm_lvsize: 20G lvm_lvfilesystem: xfs - lvm_shrink: False + lvm_shrink: false - role: ome.postgresql postgresql_databases: @@ -34,7 +38,7 @@ lvm_lvmount: '/OMERO' lvm_lvsize: 150G lvm_lvfilesystem: xfs - lvm_shrink: False + lvm_shrink: false - role: ome.lvm_partition lvm_vgname: VolGroup00 @@ -42,20 +46,20 @@ lvm_lvmount: '/opt/omero' lvm_lvsize: 40G lvm_lvfilesystem: xfs - lvm_shrink: False + lvm_shrink: false - role: ome.omero_server omero_server_python_addons: - "omero-py>={{ omero_py_release }}" omero_server_config_set: - omero.client.ui.menu.dropdown.colleagues.enabled: False + omero.client.ui.menu.dropdown.colleagues.enabled: false omero.client.ui.menu.dropdown.everyone.label: "All courses" omero.client.ui.menu.dropdown.leaders.label: "Courses:" omero.db.poolsize: 100 omero.jvmcfg.percent.blitz: 50 omero.jvmcfg.percent.indexer: 20 omero.jvmcfg.percent.pixeldata: 30 - omero.ldap.config: True + omero.ldap.config: true omero.ldap.base: "{{ omero_server_ldap_base }}" omero.ldap.username: "{{ omero_server_ldap_username }}" omero.ldap.password: "{{ omero_server_ldap_password | default('') }}" @@ -66,20 +70,20 @@ omero.mail.from: "{{ omero_server_mail_from }}" omero.mail.host: "{{ omero_server_mail_host }}" omero.policy.binary_access: "+read,+write,-image,-plate" - omero.security.ignore_case: True + omero.security.ignore_case: true omero.security.keyStore: "/etc/pki/java/cacerts" omero.security.trustStore: "/etc/pki/java/cacerts" omero.security.keyStorePassword: "changeit" omero.security.trustStorePassword: "changeit" omero.sessions.timeout: 3600000 - omero_server_selfsigned_certificates: True + omero_server_selfsigned_certificates: true - role: ome.redis - role: ome.nginx - role: ome.omero_web - omero_web_setup_nginx: False + omero_web_setup_nginx: false omero_web_config_set: omero.web.server_list: - ["localhost", 4064, "Virtual Microscope"] @@ -90,10 +94,16 @@ - webindex viewname: "webindex_custom" omero.web.ui.top_links: - - ["Virtual Microscope", "webindex", {"title": "Virtual Microscope"}] - - ["HELP", "https://help.openmicroscopy.org/virtual-microscope.html", {"title": "Help", "target": "new"}] + - - "Virtual Microscope" + - "webindex" + - {"title": "Virtual Microscope"} + - - "HELP" + - "https://help.openmicroscopy.org/virtual-microscope.html" + - {"title": "Help", "target": "new"} omero.web.ui.right_plugins: - - ["Acquisition", "webclient/data/includes/right_plugin.acquisition.js.html", "metadata_tab"] + - - "Acquisition" + - "webclient/data/includes/right_plugin.acquisition.js.html" + - "metadata_tab" omero.web.caches: default: BACKEND: django_redis.cache.RedisCache @@ -104,17 +114,27 @@ - "omero_iviewer" - "virtualmicroscope" omero.web.open_with: - - ["Image viewer", "webgateway", {"supported_objects": ["image"], "script_url": "webclient/javascript/ome.openwith_viewer.js"}] - - ["omero_iviewer", "omero_iviewer_index", {"supported_objects": ["images", "dataset", "well"], "script_url": "omero_iviewer/openwith.js", "label": "OMERO.iviewer"}] + - - "Image viewer" + - "webgateway" + - supported_objects: ["image"] + script_url: "webclient/javascript/ome.openwith_viewer.js" + - - "omero_iviewer" + - "omero_iviewer_index" + - supported_objects: ["images", "dataset", "well"] + script_url: "omero_iviewer/openwith.js" + label: "OMERO.iviewer" omero.web.viewer.view: omero_iviewer.views.index omero.web.public.enabled: true - omero.web.public.password: "{{ omero_web_public_password | default('public') }}" + omero.web.public.password: >- + {{ omero_web_public_password | default('public') }} omero.web.public.url_filter: "/(webgateway|gallery)/" - omero.web.public.user: "{{ omero_web_public_user | default('public') }}" + omero.web.public.user: >- + {{ omero_web_public_user | default('public') }} omero_web_apps_packages: - omero-gallery=={{ omero_web_apps_release.omero_gallery }} - omero-iviewer=={{ omero_web_apps_release.omero_iviewer }} - - omero-virtual-microscope=={{ omero_web_apps_release.omero_virtual_microscope }} + - "omero-virtual-microscope==\ + {{ omero_web_apps_release.omero_virtual_microscope }}" omero_web_python_addons: - "django-redis==5.0.0" - "omero-py>={{ omero_py_release }}" @@ -127,24 +147,25 @@ tasks: - - name: find OMERO.server log configuration - become: yes - find: + - name: Find OMERO.server log configuration + become: true + ansible.builtin.find: paths: /opt/omero/server/OMERO.server/etc/ patterns: "logback*.xml" register: logbacks - name: OMERO.server logs are compressed on rollover - become: yes - replace: + become: true + ansible.builtin.replace: path: "{{ item.path }}" - regexp: "(\\\\$\\{omero\\.logfile\\}\\.\\%i)(\\<\\/fileNamePattern\\>)" + regexp: "(\\\\$\\{om\ + ero\\.logfile\\}\\.\\%i)(\\<\\/fileNamePattern\\>)" replace: "\\1.gz\\2" - backup: yes + backup: true with_items: "{{ logbacks.files }}" - name: TLS certificate is installed for JVM - become: yes + become: true java_cert: cert_url: "{{ ldap_host }}" cert_port: 636 @@ -154,15 +175,15 @@ notify: restart omero-server - name: OMERO.web configuration is installed - become: yes + become: true copy: src: "files/learning-omero-web.conf" dest: "/etc/nginx/conf.d/omero-web.conf" notify: restart nginx - name: OMERO.web starts on boot - become: yes - service: + become: true + ansible.builtin.service: name: "{{ item }}.service" enabled: true loop: diff --git a/omero/nightshade-webclients.yml b/omero/nightshade-webclients.yml index 58549332..7df479ef 100644 --- a/omero/nightshade-webclients.yml +++ b/omero/nightshade-webclients.yml @@ -1,6 +1,7 @@ # Install OMERO.web with a public user on localhost -- hosts: ns-webclients +- name: Ns webclients + hosts: ns-webclients roles: @@ -25,15 +26,16 @@ - "omero-py>={{ omero_py_release }}" # Now OME are using RHEL without Spacewalk, the current best-method of - # checking `is server deployed in Dundee/SLS` is checking for the SLS nameservers. + # checking `is server deployed in Dundee/SLS` is + # checking for the SLS nameservers. - role: ome.system_monitor_agent when: "'10.1.255.216' in ansible_dns.nameservers" handlers: - - name: reload nginx + - name: Reload nginx listen: ssl certificate changed become: true - service: + ansible.builtin.service: name: nginx state: reloaded @@ -41,8 +43,8 @@ tasks: - name: Install open-vm-tools if system is a VMware vm - become: yes - yum: + become: true + ansible.builtin.yum: name: open-vm-tools state: present when: > @@ -53,30 +55,33 @@ # (Total cores / 2), leaving some for WSGI # post 2.3 'dest' should be renamed 'path' - name: NGINX - Performance tuning - worker processes - become: yes - replace: + become: true + ansible.builtin.replace: dest: "/etc/nginx/nginx.conf" regexp: '^worker_processes\s+\d+;' - replace: "worker_processes {{ ((ansible_processor_count * ansible_processor_cores) / 2) |round|int }};" + replace: >- + worker_processes {{ ((ansible_processor_count * + ansible_processor_cores) / 2) | round | int }}; # post 2.3 'dest' should be renamed 'path' - # cf https://www.digitalocean.com/community/tutorials/how-to-optimize-nginx-configuration + # cf https://www.digitalocean.com/community/tutorials/ + # how-to-optimize-nginx-configuration - name: NGINX - Performance tuning - worker connections - become: yes - replace: + become: true + ansible.builtin.replace: dest: "/etc/nginx/nginx.conf" regexp: 'worker_connections\s+\d+;' replace: "worker_connections 65000;" - name: NGINX - create nested includes directory - become: yes - file: + become: true + ansible.builtin.file: path: /etc/nginx/conf.d-nested-includes state: directory mode: 0755 - name: NGINX - SSL Configuration - become: yes + become: true template: src: templates/nginx-confdnestedincludes-ssl-conf.j2 dest: /etc/nginx/conf.d-nested-includes/ssl.conf @@ -85,7 +90,7 @@ - restart nginx - name: NGINX - Custom Paper Redirect - become: yes + become: true template: src: templates/nginx-confdnestedincludes-ns-pub-redirects-conf.j2 dest: /etc/nginx/conf.d-nested-includes/ns-pub-redirects.conf @@ -106,12 +111,18 @@ omero_web_release: "{{ omero_web_release_override | default('5.16.0') }}" omero_py_release: "{{ omero_py_release_override | default('5.13.1') }}" - omero_figure_release: "{{ omero_figure_release_override | default('5.1.0') }}" - omero_fpbioimage_release: "{{ omero_fpbioimage_release_override | default('0.4.0') }}" - omero_iviewer_release: "{{ omero_iviewer_release_override | default('0.12.0') }}" - omero_parade_release: "{{ omero_parade_release_override | default('0.2.3') }}" - omero_webtagging_autotag_release: "{{ omero_webtagging_autotag_release_override | default('3.2.0') }}" - omero_webtagging_tagsearch_release: "{{ omero_webtagging_tagsearch_release_override | default('3.2.0') }}" + omero_figure_release: >- + {{ omero_figure_release_override | default('5.1.0') }} + omero_fpbioimage_release: >- + {{ omero_fpbioimage_release_override | default('0.4.0') }} + omero_iviewer_release: >- + {{ omero_iviewer_release_override | default('0.12.0') }} + omero_parade_release: >- + {{ omero_parade_release_override | default('0.2.3') }} + omero_webtagging_autotag_release: >- + {{ omero_webtagging_autotag_release_override | default('3.2.0') }} + omero_webtagging_tagsearch_release: >- + {{ omero_webtagging_tagsearch_release_override | default('3.2.0') }} omero_web_apps_names: - omero_figure diff --git a/omero/ome-demoserver.yml b/omero/ome-demoserver.yml index b2ab72a4..066773fa 100644 --- a/omero/ome-demoserver.yml +++ b/omero/ome-demoserver.yml @@ -1,44 +1,48 @@ # Install OMERO.server, OMERO.web and prepare the OME (UoD/SLS) prerequisites -# To allow the OMERO.web plugins to upgrade, also pass `--extra-vars upgrade_webapps=True` +# To allow the OMERO.web plugins to upgrade +# also pass `--extra-vars upgrade_webapps=True` -- hosts: ome-demoservers +- name: Demo server playbook + hosts: ome-demoservers pre_tasks: - name: Install open-vm-tools if system is a VMware vm - become: yes - yum: + become: true + ansible.builtin.yum: name: open-vm-tools state: installed when: > ((ansible_virtualization_type is defined) and (ansible_virtualization_type == "VMware")) - # Perhaps alter the role at https://github.com/openmicroscopy/ansible-role-lvm-partition/ + # Perhaps alter the role at + # https://github.com/openmicroscopy/ansible-role-lvm-partition/ # to make some of the variables non-required. - name: Resize root FS without altering mount options tags: lvm - become: yes + become: true lvol: lv: root vg: VolGroup00 size: "{{ provision_root_lvsize }}" - shrink: no + shrink: false - name: Install Make Movie script Prerequisite | MEncoder - Repo - become: yes - yum: - name: http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm + become: true + ansible.builtin.yum: + name: "http://li.nux.ro/download/nux/dextop/el7\ + /x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm" state: present - name: Install Make Movie script Prerequisite | MEncoder - Package - become: yes - yum: + become: true + ansible.builtin.yum: name: mencoder state: present - name: Server-side script prerequisites - become: yes - yum: + become: true + ansible.builtin.yum: name: "{{ item }}" state: present with_items: @@ -46,7 +50,8 @@ roles: # Now OME are using RHEL without Spacewalk, the current best-method of - # checking `is server deployed in Dundee/SLS` is checking for the SLS nameservers. + # checking `is server deployed in Dundee/SLS` is + # checking for the SLS nameservers. - role: ome.system_monitor_agent tags: monitoring when: "'10.1.255.216' in ansible_dns.nameservers" @@ -59,7 +64,7 @@ lvm_lvmount: /var/lib/pgsql lvm_lvsize: "{{ provision_postgres_lvsize }}" lvm_lvfilesystem: "{{ filesystem }}" - lvm_shrink: False + lvm_shrink: false # Disk Layout - OMERO | VG and LV (separate disk) for Binary Repository - role: ome.lvm_partition @@ -69,7 +74,7 @@ lvm_lvmount: "{{ omero_server_datadir }}" lvm_lvsize: "{{ provision_omero_server_datadir_lvsize }}" lvm_lvfilesystem: "{{ filesystem }}" - lvm_shrink: False + lvm_shrink: false # Disk Layout - OMERO.server | LV for dist & logs - role: ome.lvm_partition @@ -79,7 +84,7 @@ lvm_lvmount: "{{ omero_server_basedir }}" lvm_lvsize: "{{ provision_omero_server_basedir_lvsize }}" lvm_lvfilesystem: "{{ filesystem }}" - lvm_shrink: False + lvm_shrink: false # Disk Layout - OMERO.web | LV for dist & logs - role: ome.lvm_partition @@ -89,20 +94,20 @@ lvm_lvmount: "{{ omero_web_basedir }}" lvm_lvsize: "{{ provision_omero_web_basedir_lvsize }}" lvm_lvfilesystem: "{{ filesystem }}" - lvm_shrink: False + lvm_shrink: false - role: ome.nginx nginx_version: 1.16.1 - role: ome.postgresql - #no_log: true + # no_log: true postgresql_databases: - name: omero postgresql_users: - - user: "{{ omero_server_dbuser | default('omero') }}" - password: "{{ omero_server_dbpassword | default('omero') }}" - databases: - - omero + - user: "{{ omero_server_dbuser | default('omero') }}" + password: "{{ omero_server_dbpassword | default('omero') }}" + databases: + - omero - role: ome.omero_server # Defaults overridden in private configuration @@ -119,7 +124,8 @@ - "omero-figure=={{ omero_figure_release }}" - "omero-fpbioimage=={{ omero_fpbioimage_release }}" - "omero-webtagging-autotag=={{ omero_webtagging_autotag_release }}" - - "omero-webtagging-tagsearch=={{ omero_webtagging_tagsearch_release }}" + - "omero-webtagging-tagsearch==\ + {{ omero_webtagging_tagsearch_release }}" - "omero-iviewer=={{ omero_iviewer_release }}" - "omero-parade=={{ omero_parade_release }}" - "omero-signup=={{ omero_signup_release }}" @@ -131,16 +137,17 @@ omero_user_admin_user: root omero_user_admin_pass: "{{ omero_server_rootpassword }}" omero_group_create: - - name: public - type: read-only - - name: "My Data" - type: private + - name: public + type: read-only + - name: "My Data" + type: private omero_user_create: - - login: "{{ secret_omero_web_public_user | default('public') }}" - firstname: Public - lastname: User - password: "{{ secret_omero_web_public_password | default('public') }}" - groups: "--group-name public" + - login: "{{ secret_omero_web_public_user | default('public') }}" + firstname: Public + lastname: User + password: >- + {{ secret_omero_web_public_password | default('public') }} + groups: "--group-name public" - role: ome.ssl_certificate tags: ssl @@ -152,39 +159,42 @@ postgresql_backup_minimum_expected_size: 100000000 handlers: - - name: reload web server + - name: Reload web server listen: ssl certificate changed become: true - service: + ansible.builtin.service: name: nginx state: reloaded post_tasks: - name: NGINX - Performance tuning - worker processes - become: yes - replace: + become: true + ansible.builtin.replace: path: "/etc/nginx/nginx.conf" regexp: '^worker_processes\s+\d+;' - replace: "worker_processes {{ ((ansible_processor_count * ansible_processor_cores) / 2) |round|int }};" + replace: >- + worker_processes {{ ((ansible_processor_count * + ansible_processor_cores) / 2) | round | int }}; - # cf https://www.digitalocean.com/community/tutorials/how-to-optimize-nginx-configuration + # cf https://www.digitalocean.com/community/tutorials/ + # how-to-optimize-nginx-configuration - name: NGINX - Performance tuning - worker connections - become: yes - replace: + become: true + ansible.builtin.replace: path: "/etc/nginx/nginx.conf" regexp: 'worker_connections\s+\d+;' replace: "worker_connections 65000;" - name: NGINX - create nested includes directory - become: yes - file: + become: true + ansible.builtin.file: path: /etc/nginx/conf.d-nested-includes state: directory mode: 0755 - name: NGINX - SSL Configuration - become: yes + become: true template: src: templates/nginx-confdnestedincludes-ssl-conf.j2 dest: /etc/nginx/conf.d-nested-includes/ssl.conf @@ -193,7 +203,7 @@ - restart nginx - name: NGINX - OMERO websockets - become: yes + become: true template: src: templates/nginx-confdnestedincludes-omerows-conf.j2 dest: /etc/nginx/conf.d-nested-includes/omerows.conf @@ -202,7 +212,7 @@ - restart nginx - name: NGINX - websocket proxy support - become: yes + become: true template: src: templates/nginx-confd-websockets-conf.j2 dest: /etc/nginx/conf.d/websockets.conf @@ -211,10 +221,11 @@ - restart nginx - name: Config for OMERO.web plugins - become: yes + become: true template: src: templates/omero-web-config-for-webapps.j2 - dest: "{{ omero_web_basedir }}/config/omero-web-config-for-webapps.omero" + dest: >- + {{ omero_web_basedir }}/config/omero-web-config-for-webapps.omero owner: "root" group: "root" mode: "u=rw,go=r" @@ -222,7 +233,7 @@ - restart omero-web - name: OMERO.web config for CORS - become: yes + become: true template: src: templates/omero-web-config-for-cors.j2 dest: "{{ omero_web_basedir }}/config/omero-web-config-for-cors.omero" @@ -233,7 +244,7 @@ - restart omero-web - name: OMERO.web config for signup app - become: yes + become: true template: src: templates/omero-web-config-signup.j2 dest: "{{ omero_web_basedir }}/config/omero-web-config-signup.omero" @@ -247,37 +258,43 @@ - name: Check_MK postgres plugin | check for plugin existence tags: monitoring - stat: + ansible.builtin.stat: path: "{{ check_mk_agent_plugin_path }}/mk_postgres" register: check_mk_postgres_plugin_st - name: Check_MK postgres plugin | activate the plugin tags: monitoring - become: yes - command: cp "{{ check_mk_agent_plugin_path }}/mk_postgres" /usr/share/check-mk-agent/plugins/ creates=/usr/share/check-mk-agent/plugins/mk_postgres + become: true + command: > + cp "{{ check_mk_agent_plugin_path }}/mk_postgres" + /usr/share/check-mk-agent/plugins/ + creates=/usr/share/check-mk-agent/plugins/mk_postgres when: check_mk_postgres_plugin_st.stat.exists - name: Check_MK logwatch plugin | check for plugin existence tags: monitoring - stat: + ansible.builtin.stat: path: "{{ check_mk_agent_plugin_path }}/mk_logwatch" register: check_mk_logwatch_plugin_st - name: Check_MK logwatch plugin | activate the plugin tags: monitoring - become: yes - command: cp "{{ check_mk_agent_plugin_path }}/mk_logwatch" /usr/share/check-mk-agent/plugins/ creates=/usr/share/check-mk-agent/plugins/mk_logwatch + become: true + command: > + cp "{{ check_mk_agent_plugin_path }}/mk_logwatch" + /usr/share/check-mk-agent/plugins/ + creates=/usr/share/check-mk-agent/plugins/mk_logwatch when: check_mk_logwatch_plugin_st.stat.exists - name: Check_MK logwatch plugin | check for default config file tags: monitoring - stat: + ansible.builtin.stat: path: "{{ check_mk_agent_config_example_path }}/logwatch.cfg" register: check_mk_logwatch_plugin_conf_st - name: Check_MK logwatch plugin | copy the default config tags: monitoring - become: yes + become: true command: > cp "{{ check_mk_agent_config_example_path }}/logwatch.cfg" "{{ check_mk_agent_config_path }}/logwatch.cfg" @@ -285,45 +302,59 @@ when: check_mk_logwatch_plugin_conf_st.stat.exists - name: PostgreSQL Nightly Backups | Remove old cron job - become: yes - file: + become: true + ansible.builtin.file: path: /etc/cron.daily/nightly-pg_dump-omero.sh state: absent - name: Create a figure scripts directory - become: yes - file: - path: "{{ omero_server_basedir }}/OMERO.server/lib/scripts/omero/figure_scripts" + become: true + ansible.builtin.file: + path: "{{ omero_server_basedir }}/OMERO.server/lib/\ + scripts/omero/figure_scripts" state: directory mode: 0755 - recurse: yes + recurse: true owner: root - name: Download the Figure_To_Pdf.py script - become: yes - get_url: - url: https://raw.githubusercontent.com/ome/omero-figure/{{ omero_figure_script_release }}/omero_figure/scripts/omero/figure_scripts/Figure_To_Pdf.py - dest: "{{ omero_server_basedir }}/OMERO.server/lib/scripts/omero/figure_scripts/Figure_To_Pdf.py" + become: true + ansible.builtin.get_url: + url: "https://raw.githubusercontent.com/ome/omero-figure/\ + {{ omero_figure_script_release }}/omero_figure/scripts/omero/\ + figure_scripts/Figure_To_Pdf.py" + dest: "{{ omero_server_basedir }}/OMERO.server/lib/\ + scripts/omero/figure_scripts/Figure_To_Pdf.py" mode: 0755 owner: "omero-server" group: "omero-server" - force: yes + force: true vars: - omero_figure_release: "{{ omero_figure_release_override | default('5.1.0') }}" - omero_figure_script_release: "{{ omero_figure_script_release_override | default('v5.1.0') }}" - omero_fpbioimage_release: "{{ omero_fpbioimage_release_override | default('0.4.0') }}" - omero_iviewer_release: "{{ omero_iviewer_release_override | default('0.12.0') }}" - omero_parade_release: "{{ omero_parade_release_override | default('0.2.3') }}" - omero_webtagging_autotag_release: "{{ omero_webtagging_autotag_release_override | default('3.2.0') }}" - omero_webtagging_tagsearch_release: "{{ omero_webtagging_tagsearch_release_override | default('3.2.0') }}" - omero_signup_release: "{{ omero_signup_release_override | default('0.3.2') }}" - - omero_server_release: "{{ omero_server_release_override | default('5.6.6') }}" + omero_figure_release: >- + {{ omero_figure_release_override | default('5.1.0') }} + omero_figure_script_release: >- + {{ omero_figure_script_release_override | default('v5.1.0') }} + omero_fpbioimage_release: >- + {{ omero_fpbioimage_release_override | default('0.4.0') }} + omero_iviewer_release: >- + {{ omero_iviewer_release_override | default('0.12.0') }} + omero_parade_release: >- + {{ omero_parade_release_override | default('0.2.3') }} + omero_webtagging_autotag_release: >- + {{ omero_webtagging_autotag_release_override | default('3.2.0') }} + omero_webtagging_tagsearch_release: >- + {{ omero_webtagging_tagsearch_release_override | default('3.2.0') }} + omero_signup_release: >- + {{ omero_signup_release_override | default('0.3.2') }} + + omero_server_release: >- + {{ omero_server_release_override | default('5.6.6') }} omero_web_release: "{{ omero_web_release_override | default('5.16.0') }}" omero_py_release: "{{ omero_py_release_override | default('5.13.1') }}" - # For https://github.com/openmicroscopy/ansible-role-java, which is a dependency. - java_jdk_install: True + # For https://github.com/openmicroscopy/ansible-role-java, + # which is a dependency. + java_jdk_install: true # Check_MK (system monitoring) paths check_mk_agent_plugin_path: /usr/share/check-mk-agent/available-plugins @@ -331,9 +362,12 @@ check_mk_agent_config_path: /etc/check-mk-agent # Pip versions - omero_cli_duplicate_release: "{{ omero_cli_duplicate_release_override | default('0.4.0') }}" - omero_cli_render_release: "{{ omero_cli_render_release_override | default('0.8.0') }}" - omero_metadata_release: "{{ omero_cli_metadata_release_override | default('0.10.0') }}" + omero_cli_duplicate_release: >- + {{ omero_cli_duplicate_release_override | default('0.4.0') }} + omero_cli_render_release: >- + {{ omero_cli_render_release_override | default('0.8.0') }} + omero_metadata_release: >- + {{ omero_cli_metadata_release_override | default('0.10.0') }} # Signup omero_signup_email_body: >- @@ -343,14 +377,19 @@ password: {password}\n\n Use these login details as follows\n 1. In your browser, go to demo.openmicroscopy.org and log in.\n - 2. Download the OMERO.insight [1] desktop application to import your first data into OMERO.\n - 3. Following the steps in the omero-guide [2], change the server address to\n + 2. Download the OMERO.insight [1] desktop application to im + port your first data into OMERO.\n + 3. Following the steps in the omero-guide [2], change the server ad + dress to\n demo.openmicroscopy.org and connect\n using the login details as above to import your data.\n - 4. Use the walkthrough example [3] to get ideas about how to start using OMERO.\n + 4. Use the walkthrough example [3] to get ideas about ho + w to start using OMERO.\n OME Team\n\n - [1] https://omero-guides.readthedocs.io/en/latest/upload/docs/import-desktop-client.html \n - [2] https://omero-guides.readthedocs.io/en/latest/upload/docs/import-desktop-client.html#step-by-step \n + [1] https://omero-guides.readthedocs.io/en/latest\ + /upload/docs/import-desktop-client.html \n + [2] https://omero-guides.readthedocs.io/en/latest/upload/\ + docs/import-desktop-client.html#step-by-step \n [3] https://omero-guides.readthedocs.io/en/latest/example.html \n' postgresql_version: "11" @@ -374,7 +413,8 @@ omero.mail.from: "{{ omero_server_mail_from }}" omero.mail.host: "{{ omero_server_mail_host }}" omero.new_user_group: "My Data" - omero.server.nodedescriptors: "master:Blitz-0,Indexer-0,Processor-0,Storm,Tables-0" + omero.server.nodedescriptors: >- + master:Blitz-0,Indexer-0,Processor-0,Storm,Tables-0 omero.search.batch: 100 omero.throttling.method_time.error: 60000 @@ -388,22 +428,28 @@ - markdown - "omero-py>={{ omero_py_release }}" - omero_server_selfsigned_certificates: True + omero_server_selfsigned_certificates: true omero_web_config_set: omero.mail.config: true omero.mail.from: "{{ omero_server_mail_from }}" omero.mail.host: "{{ omero_server_mail_host }}" - # https://www.openmicroscopy.org/site/support/omero5.3/sysadmins/public.html - omero.web.public.user: "{{ secret_omero_web_public_user | default('public') }}" - omero.web.public.password: "{{ secret_omero_web_public_password | default('public') }}" - omero.web.public.enabled: True + # https://www.openmicroscopy.org/site/support + # /omero5.3/sysadmins/public.html + omero.web.public.user: >- + {{ secret_omero_web_public_user | default('public') }} + omero.web.public.password: >- + {{ secret_omero_web_public_password | default('public') }} + omero.web.public.enabled: true omero.web.public.server_id: 1 - omero.web.public.url_filter: "^/(webgateway/(?!(archived_files|download_as))|webclient/annotation/([0-9]+)/)" + omero.web.public.url_filter: "^/(webgateway/(?!(archived_files|down\ + load_as))|webclient/annotation/([0-9]+)/)" omero.web.server_list: [["localhost", 4064, "omero"]] # Advice is (2*cores + 1) from OME docs. - omero.web.wsgi_workers: "{{ (2 * (ansible_processor_count * ansible_processor_cores)) + 1 }}" - omero.web.admins: "{{ omero_web_admins }}" + omero.web.wsgi_workers: >- + {{ (2 * (ansible_processor_count * + ansible_processor_cores)) + 1 }} + omero.web.admins: "{{ omero_web_admins }}" # https://pypi.org/project/omero-iviewer/ - set iviewer to default viewer omero.web.viewer.view: omero_iviewer.views.index omero.web.nginx_server_extra_config: diff --git a/omero/ome-dundeeomero.yml b/omero/ome-dundeeomero.yml index 9fe5d0c9..65893b43 100644 --- a/omero/ome-dundeeomero.yml +++ b/omero/ome-dundeeomero.yml @@ -1,10 +1,11 @@ # Install OMERO.server and prepare the OME (UoD/SLS) prerequisites -- hosts: ome-dundeeomero.openmicroscopy.org +- name: Dundeeomero server aka nightshade + hosts: ome-dundeeomero.openmicroscopy.org pre_tasks: - name: Install open-vm-tools if system is a VMware vm - become: yes - yum: + become: true + ansible.builtin.yum: name: open-vm-tools state: present when: > @@ -12,11 +13,12 @@ and (ansible_virtualization_type == "VMware")) and not (molecule_test | default(False)) - # Perhaps alter the role at https://github.com/openmicroscopy/ansible-role-lvm-partition/ + # Perhaps alter the role at + # https://github.com/openmicroscopy/ansible-role-lvm-partition/ # to make some of the variables non-required. - name: Resize root FS without altering mount options tags: lvm - become: yes + become: true lvol: lv: root vg: rhel @@ -24,14 +26,16 @@ when: "not (molecule_test | default(False))" - name: Install Make Movie script Prerequisite | MEncoder - Repo - become: yes - yum: - name: http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm - state: present + become: true + ansible.builtin.yum: + name: "http://li.nux.ro/download/nux/dextop/el7\ + /x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm" + state: latest - - name: OMERO.figure server-side prerequisites, script prerequisites + web server for decoupled OMERO.web - become: yes - yum: + # web server is included for decoupled OMERO.web + - name: OMERO.figure server-side&script prerequisites & web server + become: true + ansible.builtin.yum: name: "{{ item }}" state: present with_items: @@ -65,10 +69,10 @@ postgresql_databases: - name: "{{ omero_server_dbname | default('omero') }}" postgresql_users: - - user: "{{ omero_server_dbuser | default('omero') }}" - password: "{{ omero_server_dbpassword | default('omero') }}" - databases: - - "{{ omero_server_dbname | default('omero') }}" + - user: "{{ omero_server_dbuser | default('omero') }}" + password: "{{ omero_server_dbpassword | default('omero') }}" + databases: + - "{{ omero_server_dbname | default('omero') }}" # Note - had to have these set to `install-mock` to progress role @@ -98,33 +102,35 @@ handlers: - - name: reload nginx + - name: Reload nginx listen: ssl certificate changed become: true - service: + ansible.builtin.service: name: nginx state: reloaded tasks: - - name: Create another temporary directory since OMERO doesn't limit sizes and fills up /tmp - become: yes - file: + # OMERO doesn't limit sizes and fills up /tmp + # thus we need to create another tmp + - name: Create another temporary directory + become: true + ansible.builtin.file: path: "{{ omero_server_systemd_environment.OMERO_TMPDIR }}" state: directory mode: 0700 owner: "{{ omero_server_system_user }}" - name: NGINX - enable service / start on boot - become: yes - systemd: + become: true + ansible.builtin.systemd: name: nginx - enabled: yes + enabled: true # post 2.3 'dest' should be renamed 'path' - name: NGINX - Performance tuning - worker processes - become: yes - replace: + become: true + ansible.builtin.replace: dest: "/etc/nginx/nginx.conf" regexp: '^worker_processes\s+\d+;' replace: "worker_processes 1;" @@ -132,10 +138,11 @@ - restart nginx # post 2.3 'dest' should be renamed 'path' - # cf https://www.digitalocean.com/community/tutorials/how-to-optimize-nginx-configuration + # cf https://www.digitalocean.com/community/tutorials/how + # -to-optimize-nginx-configuration - name: NGINX - Performance tuning - worker connections - become: yes - replace: + become: true + ansible.builtin.replace: dest: "/etc/nginx/nginx.conf" regexp: 'worker_connections\s+\d+;' replace: "worker_connections 65000;" @@ -143,15 +150,15 @@ - restart nginx - name: NGINX - create nested includes directory - become: yes - file: + become: true + ansible.builtin.file: path: /etc/nginx/conf.d-nested-includes state: directory mode: 0755 # post 2.3 'destfile' should be renamed 'path' - name: NGINX - Configuration - become: yes + become: true template: src: nginx-omero.conf.j2 dest: /etc/nginx/conf.d/omero-web.conf @@ -160,82 +167,104 @@ - restart nginx - name: PostgreSQL Nightly Backups | Remove old cron job - become: yes - file: + become: true + ansible.builtin.file: path: /etc/cron.daily/nightly-pg_dump-omero.sh state: absent - name: Create a figure scripts directory - become: yes - file: + become: true + ansible.builtin.file: path: /opt/omero/server/OMERO.server/lib/scripts/omero/figure_scripts state: directory mode: 0755 - recurse: yes + recurse: true owner: root - name: Download the Figure_To_Pdf.py script - become: yes - get_url: - url: https://raw.githubusercontent.com/ome/omero-figure/v{{ omero_figure_release }}/omero_figure/scripts/omero/figure_scripts/Figure_To_Pdf.py - dest: /opt/omero/server/OMERO.server/lib/scripts/omero/figure_scripts/Figure_To_Pdf.py + become: true + ansible.builtin.get_url: + url: "https://raw.githubusercontent.com/ome\ + /omero-figure\ + /v{{ omero_figure_release }}/omero_figure/scripts\ + /omero/figure_scripts/Figure_To_Pdf.py" + dest: "/opt/omero/server/OMERO.server/lib/scripts\ + /omero/figure_scripts/Figure_To_Pdf.py" mode: 0644 owner: root - force: yes + force: true - name: Download the Dataset_Images_To_New_Figure.py script - become: yes - get_url: - url: https://raw.githubusercontent.com/ome/omero-guide-figure/f45f733a16852ae8b3c52ec93aef480d26b8e9f9/scripts/Dataset_Images_To_New_Figure.py - dest: /opt/omero/server/OMERO.server/lib/scripts/omero/figure_scripts/Dataset_Images_To_New_Figure.py + become: true + ansible.builtin.get_url: + url: "https://raw.githubusercontent.com/ome\ + /omero-guide-figure\ + /f45f733a16852ae8b3c52ec93aef480d26b8e9f9/scripts/Dataset\ + _Images_To_New_Figure.py" + dest: "/opt/omero/server/OMERO.server/lib/scripts\ + /omero/figure_scripts/Dataset_Images_To_New_Figure.py" mode: 0644 owner: root - force: yes + force: true - name: Download the Figure_Images_To_Dataset.py script - become: yes - get_url: - url: https://raw.githubusercontent.com/ome/omero-guide-figure/f45f733a16852ae8b3c52ec93aef480d26b8e9f9/scripts/Figure_Images_To_Dataset.py - dest: /opt/omero/server/OMERO.server/lib/scripts/omero/figure_scripts/Figure_Images_To_Dataset.py + become: true + ansible.builtin.get_url: + url: "https://raw.githubusercontent.com/ome\ + /omero-guide-figure\ + /f45f733a16852ae8b3c52ec93aef480d26b8e9f9/scripts/Figure\ + _Images_To_Dataset.py" + dest: "/opt/omero/server/OMERO.server/lib/scripts\ + /omero/figure_scripts/Figure_Images_To_Dataset.py" mode: 0644 owner: root - force: yes + force: true vars: - # For https://github.com/openmicroscopy/ansible-role-java, which is a dependency. - java_jdk_install: True + # For https://github.com/openmicroscopy/ansible-role-java + # which is a dependency. + java_jdk_install: true nginx_version: 1.18.0 postgresql_version: "11" filesystem: "xfs" - omero_figure_release: "{{ omero_figure_release_override | default('5.1.0') }}" + omero_figure_release: >- + {{ omero_figure_release_override | default('5.1.0') }} omero_py_release: "{{ omero_py_release_override | default('5.13.1') }}" omero_server_config_set_production: omero.db.poolsize: 60 - omero.fs.repo.path: "%user%_%userId%/%thread%//%year%-%month%/%day%/%time%" + omero.fs.repo.path: >- + %user%_%userId%/%thread%//%year%-%month%/%day%/%time% omero.jvmcfg.percent.blitz: 50 omero.jvmcfg.percent.indexer: 20 omero.jvmcfg.percent.pixeldata: 20 omero.jvmcfg.system_memory: 17000 omero.ldap.base: "{{ omero_server_ldap_base | default('example') }}" omero.ldap.config: true - omero.ldap.urls: "{{ omero_server_ldap_urls | default('ldap://example.org') }}" + omero.ldap.urls: >- + {{ omero_server_ldap_urls | default('ldap://example.org') }} omero.mail.config: true - omero.mail.from: "{{ omero_server_mail_from | default('omero@example.org') }}" - omero.mail.host: "{{ omero_server_mail_host | default('smtp.example.org') }}" + omero.mail.from: >- + {{ omero_server_mail_from | default('omero@example.org') }} + omero.mail.host: >- + {{ omero_server_mail_host | default('smtp.example.org') }} omero.ldap.new_user_group: "My Data" omero.search.batch: 100 omero.security.password_provider: chainedPasswordProvider431 omero.throttling.method_time.error: 60000 - omero.Ice.Default.Host: "{{ omero_server_ice_default_host | default('127.0.0.1') }}" - Ice.Admin.Endpoints: "{{ omero_server_ice_admin_endpoints | default('tcp -h 127.0.0.1') }}" + omero.Ice.Default.Host: >- + {{ omero_server_ice_default_host | default('127.0.0.1') }} + Ice.Admin.Endpoints: >- + {{ omero_server_ice_admin_endpoints | default('tcp -h 127.0.0.1') }} omero.data.dir: "{{ omero_server_datadir | default('/OMERO') }}" - omero_server_selfsigned_certificates: True + omero_server_selfsigned_certificates: true # Production config can't be tested in molecule - omero_server_config_set: "{{ molecule_test | default(False) | ternary({}, omero_server_config_set_production) }}" + omero_server_config_set: >- + {{ molecule_test | default(False) | + ternary({}, omero_server_config_set_production) }} omero_server_python_addons: # For OMERO.figure script - "reportlab<3.6" diff --git a/omero/omero-firewall.yml b/omero/omero-firewall.yml index d88b4f0e..2d829768 100644 --- a/omero/omero-firewall.yml +++ b/omero/omero-firewall.yml @@ -1,67 +1,68 @@ # Setup up iptables firewall on OMERO servers -- hosts: monitored +- name: Firewall + hosts: monitored roles: - - role: ome.iptables_raw + - role: ome.iptables_raw tasks: - # Allow: - # - all established/related in/out - # - all internal localhost connections - # - ICMP echo (ping) - # - ssh incoming connections - - name: Iptables ssh and related - become: yes - iptables_raw_25: - name: ssh_and_established - keep_unmanaged: no - rules: | - -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT - -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT - -A INPUT -i lo -j ACCEPT - -A INPUT -p icmp --icmp-type echo-request -j ACCEPT - -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT - state: present - # Highest priority - weight: 0 + # Allow: + # - all established/related in/out + # - all internal localhost connections + # - ICMP echo (ping) + # - ssh incoming connections + - name: Iptables ssh and related + become: true + iptables_raw_25: + name: ssh_and_established + keep_unmanaged: false + rules: | + -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT + -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT + -A INPUT -i lo -j ACCEPT + -A INPUT -p icmp --icmp-type echo-request -j ACCEPT + -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT + state: present + # Highest priority + weight: 0 - # Use a low priority REJECT rule so that clients can detect when - # they've been rejected - # The alternative of setting a default DROP policy will leave them - # hanging until they timeout, though this may be preferable for public - # servers: - # http://www.chiark.greenend.org.uk/~peterb/network/drop-vs-reject - - name: Iptables default - become: yes - iptables_raw_25: - name: default_rules - rules: | - -A INPUT -j REJECT - -A FORWARD -j REJECT - -A OUTPUT -j ACCEPT - state: present - # Lowest priority - weight: 99 + # Use a low priority REJECT rule so that clients can detect when + # they've been rejected + # The alternative of setting a default DROP policy will leave them + # hanging until they timeout, though this may be preferable for public + # servers: + # http://www.chiark.greenend.org.uk/~peterb/network/drop-vs-reject + - name: Iptables default + become: true + iptables_raw_25: + name: default_rules + rules: | + -A INPUT -j REJECT + -A FORWARD -j REJECT + -A OUTPUT -j ACCEPT + state: present + # Lowest priority + weight: 99 - # All other ports that allow incoming connections: - # - web - # - omero - # - GPFS - # - Check_MK - - name: Iptables OME ports - become: yes - iptables_raw_25: - name: ome_ports - rules: | - -A INPUT -p tcp -m multiport --dports 80,443 -j ACCEPT - -A INPUT -p tcp -m multiport --dports 4063,4064 -j ACCEPT - {% for s in gpfs_cluster_source | default([]) %} - -A INPUT -p tcp -m tcp --dport 1191 -s {{ s }} -j ACCEPT - {% endfor %} - {% if (checkmk_server_source | default('')) %} - -A INPUT -p tcp -m tcp --dport 6556 -s {{ checkmk_server_source }} -j ACCEPT - {% endif %} - state: present + # All other ports that allow incoming connections: + # - web + # - omero + # - GPFS + # - Check_MK + - name: Iptables OME ports + become: true + iptables_raw_25: + name: ome_ports + rules: | + -A INPUT -p tcp -m multiport --dports 80,443 -j ACCEPT + -A INPUT -p tcp -m multiport --dports 4063,4064 -j ACCEPT + {% for s in gpfs_cluster_source | default([]) %} + -A INPUT -p tcp -m tcp --dport 1191 -s {{ s }} -j ACCEPT + {% endfor %} + {% if (checkmk_server_source | default('')) %} + -A INPUT -p tcp -m tcp --dport 6556 -s {{ checkmk_server_source }} -j ACCEPT + {% endif %} + state: present diff --git a/omero/omero-monitoring-agents.yml b/omero/omero-monitoring-agents.yml index 6d4f724a..5a513ef5 100644 --- a/omero/omero-monitoring-agents.yml +++ b/omero/omero-monitoring-agents.yml @@ -1,108 +1,115 @@ # Setup prometheus agents -- hosts: omero-server +- name: Monitoring agents + hosts: omero-server roles: - - role: ome.prometheus_jmx + - role: ome.prometheus_jmx - - role: ome.prometheus_postgres - prometheus_postgres_dbname: omero + - role: ome.prometheus_postgres + prometheus_postgres_dbname: omero - # For restart handlers - - role: ome.omero_common + # For restart handlers + - role: ome.omero_common - - role: ome.omero_prometheus_exporter - omero_prometheus_exporter_omero_user: "{{ secret_omero_prometheus_exporter_omero_user | default('root') }}" - omero_prometheus_exporter_omero_password: "{{ secret_omero_prometheus_exporter_omero_password | default('omero') }}" + - role: ome.omero_prometheus_exporter + omero_prometheus_exporter_omero_user: >- + {{ secret_omero_prometheus_exporter_omero_user | default('root') }} + omero_prometheus_exporter_omero_password: >- + {{ secret_omero_prometheus_exporter_omero_password + | default('omero') }} tasks: - - name: omero-server prometheus jmx agents - become: yes - copy: - dest: "{{ omero_common_basedir }}/server/config/prometheus.omero" - src: omero-server-config-prometheus.omero - mode: 0644 - notify: - - restart omero-server + - name: Omero-server prometheus jmx agents + become: true + copy: + dest: "{{ omero_common_basedir }}/server/config/prometheus.omero" + src: omero-server-config-prometheus.omero + mode: 0644 + notify: + - restart omero-server - -- hosts: omero-web +- name: OMERO web + hosts: omero-web roles: - - role: ome.omero_web_django_prometheus + - role: ome.omero_web_django_prometheus # NOTE: This assumes omero-web.conf is present and includes # /etc/nginx/conf.d-nested-includes -- hosts: monitored +- name: Monitoring + hosts: monitored roles: - - role: ome.prometheus_node + - role: ome.prometheus_node # Autodetect whether selinux is enabled - - role: ome.selinux_utils + - role: ome.selinux_utils tasks: - - name: nginx selinux allow network connect - become: yes - seboolean: - name: httpd_can_network_connect - state: yes - persistent: yes - when: selinux_enabled - - - name: Create monitoring htpasswd - become: yes - copy: - content: "{{ secret_monitoring_nginx_htpasswd | default(monitoring_nginx_htpasswd) }}" - dest: /etc/nginx/monitoring.htpasswd - mode: 0644 - - # This is fine to apply to all servers because if an exporter doesn't - # exist it will return an error, and we know which exporters to expect - # when scraping - - name: Create nginx proxy for prometheus exporters - become: yes - copy: - dest: /etc/nginx/conf.d-nested-includes/proxy-exporters.conf - src: confd-nested-proxy-exporters.conf - mode: 0644 - notify: - - restart nginx + - name: Nginx selinux allow network connect + become: true + seboolean: + name: httpd_can_network_connect + state: true + persistent: true + when: selinux_enabled + + - name: Create monitoring htpasswd + become: true + copy: + content: >- + {{ secret_monitoring_nginx_htpasswd | + default(monitoring_nginx_htpasswd) }} + dest: /etc/nginx/monitoring.htpasswd + mode: 0644 + + # This is fine to apply to all servers because if an exporter doesn't + # exist it will return an error, and we know which exporters to expect + # when scraping + - name: Create nginx proxy for prometheus exporters + become: true + copy: + dest: /etc/nginx/conf.d-nested-includes/proxy-exporters.conf + src: confd-nested-proxy-exporters.conf + mode: 0644 + notify: + - restart nginx handlers: - - name: restart nginx - become: yes - service: - name: nginx - state: restarted + - name: restart nginx + become: true + service: + name: nginx + state: restarted vars: # monitoring:monitoring monitoring_nginx_htpasswd: | monitoring:$apr1$njrafrtU$19wf/I15zPuSudlM5Y50Z0 - -- hosts: omero-web +- name: OMERO-web + hosts: omero-web tasks: - - name: Create nginx proxy for prometheus web exporters - become: yes - copy: - dest: /etc/nginx/conf.d-nested-includes/proxy-exporters-web.conf - src: confd-nested-proxy-exporters-web.conf - mode: 0644 - notify: - - restart nginx + - name: Create nginx proxy for prometheus web exporters + become: true + copy: + dest: /etc/nginx/conf.d-nested-includes/proxy-exporters-web.conf + src: confd-nested-proxy-exporters-web.conf + mode: 0644 + notify: + - restart nginx handlers: - - name: restart nginx - become: yes - service: - name: nginx - state: restarted + - name: restart nginx + become: true + service: + name: nginx + state: restarted diff --git a/omero/sls-gallery.yml b/omero/sls-gallery.yml index 9fac1d1c..6c817b46 100644 --- a/omero/sls-gallery.yml +++ b/omero/sls-gallery.yml @@ -8,7 +8,8 @@ # - bin/omero db password for root user. # - systemctl start omero-{server,web} -- hosts: omero-sls-gallery +- name: Sls gallery + hosts: omero-sls-gallery roles: - role: ome.lvm_partition lvm_vgname: VolGroup00 @@ -16,7 +17,7 @@ lvm_lvmount: '/var/lib/pgsql' lvm_lvsize: 8G lvm_lvfilesystem: xfs - lvm_shrink: False + lvm_shrink: false - role: ome.postgresql postgresql_databases: @@ -38,7 +39,7 @@ lvm_lvmount: '/OMERO' lvm_lvsize: 80G lvm_lvfilesystem: xfs - lvm_shrink: False + lvm_shrink: false - role: ome.lvm_partition lvm_vgname: VolGroup00 @@ -46,18 +47,18 @@ lvm_lvmount: '/opt/omero' lvm_lvsize: 40G lvm_lvfilesystem: xfs - lvm_shrink: False + lvm_shrink: false - role: ome.omero_server omero_server_config_set: - omero.client.ui.menu.dropdown.colleagues.enabled: False + omero.client.ui.menu.dropdown.colleagues.enabled: false omero.client.ui.menu.dropdown.everyone.label: "All images" omero.client.ui.menu.dropdown.leaders.label: "Gallery:" omero.db.poolsize: 50 omero.jvmcfg.percent.blitz: 50 omero.jvmcfg.percent.indexer: 20 omero.jvmcfg.percent.pixeldata: 30 - omero.ldap.config: True + omero.ldap.config: true omero.ldap.base: "{{ omero_server_ldap_base }}" omero.ldap.username: "{{ omero_server_ldap_username }}" omero.ldap.user_filter: "{{ omero_server_ldap_user_filter }}" @@ -70,15 +71,15 @@ omero.mail.host: "{{ omero_server_mail_host }}" omero.pixeldata.max_plane_height: 5120 omero.pixeldata.max_plane_width: 5120 - omero_server_selfsigned_certificates: True + omero_server_selfsigned_certificates: true - role: ome.redis - role: ome.nginx - role: ome.omero_web - omero_web_setup_nginx: False - omero_web_systemd_start: True + omero_web_setup_nginx: false + omero_web_systemd_start: true omero_web_config_set: omero.web.server_list: - ["localhost", 4064, "SLS Gallery"] @@ -92,9 +93,17 @@ args: - userdata omero.web.ui.top_links: - - ["Image Gallery", "webindex", {"title": "Image Gallery"}] - - ["HELP", "https://help.openmicroscopy.org/web-client.html", {"title": "Help", "target": "new"}] - - ["SLS Homepage", "https://www.lifesci.dundee.ac.uk/", {"title": "SLS Homepage", "target": "new"}] + - - "Image Gallery" + - "webindex" + - title: "Image Gallery" + - - "HELP" + - "https://help.openmicroscopy.org/web-client.html" + - title: "Help" + target": "new" + - - "SLS Homepage" + - "https://www.lifesci.dundee.ac.uk/" + - title: "SLS Homepage" + target: "new" omero.web.caches: default: BACKEND: django_redis.cache.RedisCache @@ -103,8 +112,15 @@ omero.web.apps: - "omero_iviewer" omero.web.open_with: - - ["Image viewer", "webgateway", {"supported_objects": ["image"], "script_url": "webclient/javascript/ome.openwith_viewer.js"}] - - ["omero_iviewer", "omero_iviewer_index", {"supported_objects": ["images", "dataset", "well"], "script_url": "omero_iviewer/openwith.js", "label": "OMERO.iviewer"}] + - - "Image viewer" + - "webgateway" + - supported_objects: ["image"] + script_url: "webclient/javascript/ome.openwith_viewer.js" + - - "omero_iviewer" + - "omero_iviewer_index" + - supported_objects": ["images", "dataset", "well"] + script_url": "omero_iviewer/openwith.js" + label: "OMERO.iviewer" omero.web.viewer.view: omero_iviewer.views.index omero_web_apps_packages: - omero-iviewer=={{ omero_web_apps_release.omero_iviewer }} @@ -113,32 +129,33 @@ - "omero-py>={{ omero_py_release }}" tasks: - - name: find OMERO.server log configuration - become: yes - find: + - name: Find OMERO.server log configuration + become: true + ansible.builtin.find: paths: /opt/omero/server/OMERO.server/etc/ patterns: "logback*.xml" register: logbacks - name: OMERO.server logs are compressed on rollover - become: yes + become: true replace: path: "{{ item.path }}" - regexp: "(\\\\$\\{omero\\.logfile\\}\\.\\%i)(\\<\\/fileNamePattern\\>)" + regexp: "(\\\\$\\{om\ + ero\\.logfile\\}\\.\\%i)(\\<\\/fileNamePattern\\>)" replace: "\\1.gz\\2" - backup: yes + backup: true with_items: "{{ logbacks.files }}" - name: OMERO.web configuration is installed - become: yes + become: true copy: src: "files/sls-gallery-omero-web.conf" dest: "/etc/nginx/conf.d/omero-web.conf" notify: restart nginx - name: OMERO.web starts on boot - become: yes - service: + become: true + ansible.builtin.service: name: "{{ item }}.service" enabled: true loop: diff --git a/omero/training-server/idr_data.yml b/omero/training-server/idr_data.yml index f43ceefa..cc80eef0 100644 --- a/omero/training-server/idr_data.yml +++ b/omero/training-server/idr_data.yml @@ -1,23 +1,24 @@ --- -- hosts: ome-outreach +- name: IDR data + hosts: ome-outreach tasks: - name: Clone study metadata - become: yes - git: + become: true + ansible.builtin.git: dest: /uod/idr/metadata/{{ item.name }} repo: https://github.com/IDR/{{ item.name }} - update: yes + update: true version: "{{ item.version }}" loop: "{{ studies | default([]) }}" - name: Check existence of study data directory - stat: + ansible.builtin.stat: path: /uod/idr/filesets/{{ item.name }} register: stat_results loop: "{{ studies | default([]) }}" - name: Fail if data directory is missing - fail: + ansible.builtin.fail: msg: "/uod/idr/filesets/{{ item.item }} does not exist" when: not item.stat.exists loop: "{{ stat_results.results }}" diff --git a/omero/training-server/playbook.yml b/omero/training-server/playbook.yml index bbd3095c..622fb50a 100644 --- a/omero/training-server/playbook.yml +++ b/omero/training-server/playbook.yml @@ -504,5 +504,8 @@ external_nic: "{{ ansible_default_ipv4.interface }}" -- include: letsencrypt.yml -- include: idr_data.yml +- name: Import letsencrypt + import_playbook: letsencrypt.yml + +- name: Import idr data + import_playbook: idr_data.yml diff --git a/release/group_vars/all.yml b/release/group_vars/all.yml index 1fd43ffd..8763f782 100644 --- a/release/group_vars/all.yml +++ b/release/group_vars/all.yml @@ -51,11 +51,17 @@ public_folders: # List containing special public images/folders that do not meet the standard # layout above special_public_folders: - - { src: '../../../../repos/curated/samples/carlos/big.tiff', dest: 'gateway_tests/big.tiff'} - - { src: '../../../../repos/curated/samples/ome/CHOBI_d3d.dv', dest: 'gateway_tests/CHOBI_d3d.dv'} - - { src: '../../../../repos/curated/samples/ome/tinyTest.d3d.dv', - dest: 'gateway_tests/tinyTest.d3d.dv' } - - { src: '../../../../repos/curated/cellomics/public/', dest: 'HCS/BBBC'} - - { src: '../../../../repos/curated/incell/public/', dest: 'HCS/INCELL2000'} - - { src: '../../../../repos/curated/perkinelmer-operetta/public/', dest: 'HCS/Operetta'} - - { src: '../../../repos/curated/zip/u-track/', dest: 'u-track'} + - src: '../../../../repos/curated/samples/carlos/big.tiff' + dest: 'gateway_tests/big.tiff' + - src: '../../../../repos/curated/samples/ome/CHOBI_d3d.dv' + dest: 'gateway_tests/CHOBI_d3d.dv' + - src: '../../../../repos/curated/samples/ome/tinyTest.d3d.dv' + dest: 'gateway_tests/tinyTest.d3d.dv' + - src: '../../../../repos/curated/cellomics/public/' + dest: 'HCS/BBBC' + - src: '../../../../repos/curated/incell/public/' + dest: 'HCS/INCELL2000' + - src: '../../../../repos/curated/perkinelmer-operetta/public/' + dest: 'HCS/Operetta' + - src: '../../../repos/curated/zip/u-track/' + dest: 'u-track' diff --git a/release/permissions.yml b/release/permissions.yml index ac3c5525..400bddfe 100644 --- a/release/permissions.yml +++ b/release/permissions.yml @@ -1,29 +1,34 @@ --- -- hosts: idr0-slot3.openmicroscopy.org +- name: Permissions + hosts: idr0-slot3.openmicroscopy.org become: true tasks: - - file: - path: /uod/idr/www - state: directory - owner: root - group: root - mode: 0755 + - name: Set perms /uod/idr/www + ansible.builtin.file: + path: /uod/idr/www + state: directory + owner: root + group: root + mode: 0755 - - file: - path: "{{ item }}" - state: directory - owner: root - group: root - mode: 0755 + - name: Set perms2 + ansible.builtin.file: + path: "{{ item }}" + state: directory + owner: root + group: root + mode: 0755 with_items: "{{ www_folders }}" - - find: + - name: Set perms3 www_folders + ansible.builtin.find: paths: "{{ www_folders }}" file_type: "directory" recurse: "no" register: "products" - - file: + - name: Set perms3 + ansible.builtin.file: path: "{{ item }}" state: directory owner: root diff --git a/release/presentations.yml b/release/presentations.yml index 55763bd9..f953a14a 100644 --- a/release/presentations.yml +++ b/release/presentations.yml @@ -1,10 +1,13 @@ --- -- hosts: idr0-slot3.openmicroscopy.org +- name: Presentations playbook + hosts: idr0-slot3.openmicroscopy.org become: true +# yamllint disable rule:latest tasks: - - name: update presentations - git: + - name: Update presentations + ansible.builtin.git: repo: https://github.com/ome/presentations - force: no - update: yes + force: false + update: true dest: "/uod/idr/www/downloads.openmicroscopy.org/presentations" +# yamllint disable rule:latest diff --git a/release/public-images.yml b/release/public-images.yml index 1a960418..ce649a69 100644 --- a/release/public-images.yml +++ b/release/public-images.yml @@ -1,18 +1,25 @@ --- -- hosts: idr0-slot3.openmicroscopy.org +- name: Public images + hosts: idr0-slot3.openmicroscopy.org become: true tasks: - - name: create symlinks for public images - file: - force: yes + - name: Create symlinks for public images + ansible.builtin.file: + force: true src: "../../../repos/curated/{{ item.key }}/public/" - dest: "/uod/idr/www/downloads.openmicroscopy.org/images/{{ item.value }}" + dest: > + "/uod/idr/www/downloads. + openmicroscopy.org/ + images/{{ item.value }}" state: link with_dict: "{{ public_folders }}" - - name: check public images - file: - force: yes + - name: Check public images + ansible.builtin.file: + force: true src: "{{ item.src }}" - dest: "/uod/idr/www/downloads.openmicroscopy.org/images/{{ item.dest }}" + dest: > + "/uod/idr/www/downloads. + openmicroscopy.org/ + images/{{ item.dest }}" state: link - with_items: "{{ special_public_folders }}" \ No newline at end of file + with_items: "{{ special_public_folders }}" diff --git a/release/release-acceptance.yml b/release/release-acceptance.yml index fb09b9bf..75adaad6 100644 --- a/release/release-acceptance.yml +++ b/release/release-acceptance.yml @@ -1,5 +1,6 @@ --- -- hosts: idr0-slot3.openmicroscopy.org +- name: Release acceptance + hosts: idr0-slot3.openmicroscopy.org become: true tasks: - name: Check mandatory variables are defined diff --git a/site.yml b/site.yml index 0232abd5..10bf0d04 100644 --- a/site.yml +++ b/site.yml @@ -3,32 +3,32 @@ # For new hosts you may also need to run the bootstrap playbook to setup # networking and initial partitions: -#- include: bootstrap/playbook.yml +# - import_playbook: bootstrap/playbook.yml # deployment of two OMERO.web instances for hosting Dundee's production OMERO. # One of the two instances is for publication data ("ns-web-pub"). -- include: omero/nightshade-webclients.yml +- import_playbook: omero/nightshade-webclients.yml # nightshade.openmicroscopy.org OMERO.server -- include: omero/ome-dundeeomero.yml +- import_playbook: omero/ome-dundeeomero.yml # https://demo.openmicroscopy.org OMERO.server and OMERO.web -- include: omero/ome-demoserver.yml +- import_playbook: omero/ome-demoserver.yml # Firewall configuration for all UoD OMERO servers # The training-server playbooks modify the firewall configuration so this must # be run first to setup the basic rules -- include: omero/omero-firewall.yml +- import_playbook: omero/omero-firewall.yml # https://outreach.openmicroscopy.org # https://workshop.openmicroscopy.org -- include: omero/training-server/playbook.yml +- import_playbook: omero/training-server/playbook.yml # Internal monitoring configuration for all UoD OMERO servers -- include: omero/omero-monitoring-agents.yml +- import_playbook: omero/omero-monitoring-agents.yml # https://www.openmicroscopy.org/ -- include: www/playbook.yml +- import_playbook: www/playbook.yml # OME proxied service -- include: web-proxy/playbook.yml +- import_playbook: web-proxy/playbook.yml diff --git a/web-proxy/playbook.yml b/web-proxy/playbook.yml index 9c6f3e81..84a0fe8a 100644 --- a/web-proxy/playbook.yml +++ b/web-proxy/playbook.yml @@ -1,30 +1,31 @@ --- # Playbook for maintaining OME production web proxies -- hosts: web-proxies +- name: Web proxy + hosts: web-proxies roles: - - role: ome.network - tags: network - - role: ome.lvm_partition - tags: lvm - lvm_lvname: root - lvm_lvmount: / - lvm_lvsize: "{{ root_size }}" - lvm_lvfilesystem: "{{ root_filesystem }}" - - role: ome.lvm_partition - tags: lvm - lvm_lvname: var_log - lvm_lvmount: /var/log - lvm_lvsize: "{{ varlog_size }}" - lvm_lvfilesystem: "{{ root_filesystem }}" - - role: ome.ssl_certificate - - role: ome.nginx_proxy + - role: ome.network + tags: network + - role: ome.lvm_partition + tags: lvm + lvm_lvname: root + lvm_lvmount: / + lvm_lvsize: "{{ root_size }}" + lvm_lvfilesystem: "{{ root_filesystem }}" + - role: ome.lvm_partition + tags: lvm + lvm_lvname: var_log + lvm_lvmount: /var/log + lvm_lvsize: "{{ varlog_size }}" + lvm_lvfilesystem: "{{ root_filesystem }}" + - role: ome.ssl_certificate + - role: ome.nginx_proxy handlers: - - name: reload nginx + - name: Reload nginx listen: ssl certificate changed become: true - service: + ansible.builtin.service: name: nginx state: reloaded diff --git a/www/playbook.yml b/www/playbook.yml index c563cfc0..8c8fb53b 100644 --- a/www/playbook.yml +++ b/www/playbook.yml @@ -1,110 +1,116 @@ # Install NGINX, and prepare the OME (UoD/SLS) prerequisites -- hosts: www +- name: Playbook www + hosts: www environment: PATH: /usr/local/bin:{{ ansible_env.PATH }} pre_tasks: - - name: Install open-vm-tools if system is a VMware vm - become: yes - yum: - name: open-vm-tools - state: installed - when: > - ((ansible_virtualization_type is defined) - and (ansible_virtualization_type == "VMware")) - - # Two tasks here which could instead use the role at - # https://github.com/openmicroscopy/ansible-role-lvm-partition/, but that role - # will change the device name to symlinks rather than existing device ID. - - name: storage | Resize root LV - tags: lvm - become: yes - lvol: - lv: root - vg: "{{ lvm_vgname }}" - size: "{{ provision_root_lvsize }}" - shrink: no - - # Grow the filesystem to fill the LV - - name: storage | Resize root FS - tags: lvm - become: yes - filesystem: - fstype: "{{ filesystem }}" - dev: /dev/mapper/{{ lvm_vgname }}-root - resizefs: yes - - - name: storage | Resize var_log LV - tags: lvm - become: yes - lvol: - lv: var_log - vg: "{{ lvm_vgname }}" - size: "{{ provision_varlog_lvsize }}" - shrink: no - - # Grow the filesystem to fill the LV - - name: storage | Resize var_log FS - tags: lvm - become: yes - filesystem: - fstype: "{{ filesystem }}" - dev: /dev/mapper/{{ lvm_vgname }}-var_log - resizefs: yes + - name: Install open-vm-tools if system is a VMware vm + become: true + ansible.builtin.yum: + name: open-vm-tools + state: installed + when: > + ((ansible_virtualization_type is defined) + and (ansible_virtualization_type == "VMware")) + + # Two tasks here which could instead use the role at + # https://github.com/openmicroscopy/ansible-role-lvm-partition/, + # but that role + # will change the device name to symlinks rather than + # existing device ID. + - name: storage | Resize root LV + tags: lvm + become: true + lvol: + lv: root + vg: "{{ lvm_vgname }}" + size: "{{ provision_root_lvsize }}" + shrink: false + + # Grow the filesystem to fill the LV + - name: storage | Resize root FS + tags: lvm + become: true + filesystem: + fstype: "{{ filesystem }}" + dev: /dev/mapper/{{ lvm_vgname }}-root + resizefs: true + + - name: storage | Resize var_log LV + tags: lvm + become: true + lvol: + lv: var_log + vg: "{{ lvm_vgname }}" + size: "{{ provision_varlog_lvsize }}" + shrink: false + + # Grow the filesystem to fill the LV + - name: storage | Resize var_log FS + tags: lvm + become: true + filesystem: + fstype: "{{ filesystem }}" + dev: /dev/mapper/{{ lvm_vgname }}-var_log + resizefs: true roles: - # Now OME are using RHEL without Spacewalk, the current best-method of - # checking `is server deployed in Dundee/SLS` is checking for the SLS nameservers. - - role: ome.system_monitor_agent - tags: monitoring - when: "'10.1.255.216' in ansible_dns.nameservers" - - - role: ome.sudoers - sudoers_individual_commands: - - user: "%omedev" - become: ALL - command: "NOPASSWD: /usr/local/bin/deploy *" + # Now OME are using RHEL without Spacewalk, + # the current best-method of + # checking `is server deployed in Dundee/SLS` + # is checking for the SLS nameservers. + - role: ome.system_monitor_agent + tags: monitoring + when: "'10.1.255.216' in ansible_dns.nameservers" + + - role: ome.sudoers + sudoers_individual_commands: + - user: "%omedev" + become: ALL + command: "NOPASSWD: /usr/local/bin/deploy *" post_tasks: - - name: Check_MK logwatch plugin | check for plugin existence - tags: monitoring - stat: - path: "{{ check_mk_agent_plugin_path }}/mk_logwatch" - register: check_mk_logwatch_plugin_st - - - name: Check_MK logwatch plugin | activate the plugin - tags: monitoring - become: yes - command: >- - cp "{{ check_mk_agent_plugin_path }}/mk_logwatch" - /usr/share/check-mk-agent/plugins/ - creates=/usr/share/check-mk-agent/plugins/mk_logwatch - when: check_mk_logwatch_plugin_st.stat.exists - - - name: Check_MK logwatch plugin | check for default config file - tags: monitoring - stat: - path: "{{ check_mk_agent_config_example_path }}/logwatch.cfg" - register: check_mk_logwatch_plugin_conf_st - - - name: Check_MK logwatch plugin | copy the default config - tags: monitoring - become: yes - command: >- - cp "{{ check_mk_agent_config_example_path }}/logwatch.cfg" - "{{ check_mk_agent_config_path }}/logwatch.cfg" - creates="{{ check_mk_agent_config_path }}/logwatch.cfg" - when: check_mk_logwatch_plugin_conf_st.stat.exists + - name: Check_MK logwatch plugin | check for plugin existence + tags: monitoring + ansible.builtin.stat: + path: "{{ check_mk_agent_plugin_path }}/mk_logwatch" + register: check_mk_logwatch_plugin_st + + - name: Check_MK logwatch plugin | activate the plugin + tags: monitoring + become: true + command: >- + cp "{{ check_mk_agent_plugin_path }}/mk_logwatch" + /usr/share/check-mk-agent/plugins/ + creates=/usr/share/check-mk-agent/plugins/mk_logwatch + when: check_mk_logwatch_plugin_st.stat.exists + + - name: Check_MK logwatch plugin | check for default config file + tags: monitoring + ansible.builtin.stat: + path: "{{ check_mk_agent_config_example_path }}/logwatch.cfg" + register: check_mk_logwatch_plugin_conf_st + + - name: Check_MK logwatch plugin | copy the default config + tags: monitoring + become: true + command: >- + cp "{{ check_mk_agent_config_example_path }}/logwatch.cfg" + "{{ check_mk_agent_config_path }}/logwatch.cfg" + creates="{{ check_mk_agent_config_path }}/logwatch.cfg" + when: check_mk_logwatch_plugin_conf_st.stat.exists vars: - # Check_MK (system monitoring) paths - check_mk_agent_plugin_path: /usr/share/check-mk-agent/available-plugins - check_mk_agent_config_example_path: /usr/share/check_mk/agents/cfg_examples - check_mk_agent_config_path: /etc/check-mk-agent - - filesystem: "ext4" + # Check_MK (system monitoring) paths + check_mk_agent_plugin_path: /usr/share/check-mk-agent/available-plugins + check_mk_agent_config_example_path: "/usr/share\ + /check_mk/agents/cfg_examples" + check_mk_agent_config_path: /etc/check-mk-agent + filesystem: "ext4" -- include: www-deploy.yml +- name: Import www deploy + import_playbook: www-deploy.yml # www-deploy.yml includes www-jekyll.yml diff --git a/www/tests/check_redirects.py b/www/tests/check_redirects.py index 32c803da..2e45aa1d 100644 --- a/www/tests/check_redirects.py +++ b/www/tests/check_redirects.py @@ -33,10 +33,12 @@ ('/site/community/mailing-lists', '/support'), ('/site/events', '/events'), ('/site/community/minutes/conference-calls', '/on-the-web'), - ('/site/community/minutes/meetings/12th-annual-users-meeting-2017', '/events/12th-annual-users-meeting-2017.html'), - ('/site/community/minutes/meetings/11th-annual-users-meeting-2016', '/events/11th-annual-users-meeting-2016.html'), - ('/site/community/minutes/meetings/10th-annual-users-meeting-june-2015', '/events/10th-annual-users-meeting-june-2015.html'), - ('/site/community/minutes/meetings/9th-annual-users-meeting-june-2014', '/events/9th-annual-users-meeting-june-2014.html'), + ('/site/community/minutes/meetings/12th-annual-users-meeting-2017', + '/events/12th-annual-users-meeting-2017.html'), + ('/site/community/minutes/meetings/11th-annual-users-meeting-2016', + '/events/11th-annual-users-meeting-2016.html'), + ('/site/community/minutes/meetings/10th-annual-users-meeting-june-2015', '/events/10th-annual-users-meeting-june-2015.html'),# noqa + ('/site/community/minutes/meetings/9th-annual-users-meeting-june-2014', '/events/9th-annual-users-meeting-june-2014.html'),# noqa ('/site/community/jobs', '/careers'), ('/site/products', '/products'), @@ -66,40 +68,40 @@ ] external_uris = [ ('/omero-blog', 'http://blog.openmicroscopy.org'), - ('/site/about/development-teams/glencoe-software', 'https://www.glencoesoftware.com/team.html'), - ('/site/community/scripts', 'https://docs.openmicroscopy.org/latest/omero/developers/scripts/index.html'), - ('/site/support/bio-formats', 'https://docs.openmicroscopy.org/latest/bio-formats/'), - ('/site/support/bio-formats5', 'https://docs.openmicroscopy.org/latest/bio-formats5/'), - ('/site/support/bio-formats5.3', 'https://docs.openmicroscopy.org/latest/bio-formats5.3/'), - ('/site/support/bio-formats5.4', 'https://docs.openmicroscopy.org/latest/bio-formats5.4/'), - ('/site/support/bio-formats5.5', 'https://docs.openmicroscopy.org/latest/bio-formats5.5/'), - ('/site/support/omero', 'https://docs.openmicroscopy.org/latest/omero/'), - ('/site/support/omero5', 'https://docs.openmicroscopy.org/latest/omero5/'), - ('/site/support/omero5.0', 'https://docs.openmicroscopy.org/latest/omero5.0/'), - ('/site/support/omero5.1', 'https://docs.openmicroscopy.org/latest/omero5.1/'), - ('/site/support/omero5.2', 'https://docs.openmicroscopy.org/latest/omero5.2/'), - ('/site/support/omero5.3', 'https://docs.openmicroscopy.org/latest/omero5.3/'), - ('/site/support/ome-model', 'https://docs.openmicroscopy.org/latest/ome-model/'), - ('/site/support/file-formats', 'https://docs.openmicroscopy.org/latest/ome-model/'), - ('/site/support/file-formats/schemas/specifications/compliant-file-specification', 'https://docs.openmicroscopy.org/latest/ome-model/specifications/'), - ('/site/support/ome-tiff', 'https://docs.openmicroscopy.org/latest/ome-model/ome-tiff/'), - ('/site/support/ome-files-cpp', 'https://docs.openmicroscopy.org/latest/ome-files-cpp/'), - ('/site/support/contributing', 'https://docs.openmicroscopy.org/contributing/'), + ('/site/about/development-teams/glencoe-software', 'https://www.glencoesoftware.com/team.html'),# noqa + ('/site/community/scripts', 'https://docs.openmicroscopy.org/latest/omero/developers/scripts/index.html'),# noqa + ('/site/support/bio-formats', 'https://docs.openmicroscopy.org/latest/bio-formats/'),# noqa + ('/site/support/bio-formats5', 'https://docs.openmicroscopy.org/latest/bio-formats5/'),# noqa + ('/site/support/bio-formats5.3', 'https://docs.openmicroscopy.org/latest/bio-formats5.3/'),# noqa + ('/site/support/bio-formats5.4', 'https://docs.openmicroscopy.org/latest/bio-formats5.4/'),# noqa + ('/site/support/bio-formats5.5', 'https://docs.openmicroscopy.org/latest/bio-formats5.5/'),# noqa + ('/site/support/omero', 'https://docs.openmicroscopy.org/latest/omero/'),# noqa + ('/site/support/omero5', 'https://docs.openmicroscopy.org/latest/omero5/'),# noqa + ('/site/support/omero5.0', 'https://docs.openmicroscopy.org/latest/omero5.0/'),# noqa + ('/site/support/omero5.1', 'https://docs.openmicroscopy.org/latest/omero5.1/'),# noqa + ('/site/support/omero5.2', 'https://docs.openmicroscopy.org/latest/omero5.2/'),# noqa + ('/site/support/omero5.3', 'https://docs.openmicroscopy.org/latest/omero5.3/'),# noqa + ('/site/support/ome-model', 'https://docs.openmicroscopy.org/latest/ome-model/'),# noqa + ('/site/support/file-formats', 'https://docs.openmicroscopy.org/latest/ome-model/'),# noqa + ('/site/support/file-formats/schemas/specifications/compliant-file-specification', 'https://docs.openmicroscopy.org/latest/ome-model/specifications/'),# noqa + ('/site/support/ome-tiff', 'https://docs.openmicroscopy.org/latest/ome-model/ome-tiff/'),# noqa + ('/site/support/ome-files-cpp', 'https://docs.openmicroscopy.org/latest/ome-files-cpp/'),# noqa + ('/site/support/contributing', 'https://docs.openmicroscopy.org/contributing/'),# noqa ('/site/support/previous', 'https://docs.openmicroscopy.org'), - ('/info/OMERO.insight', 'https://docs.openmicroscopy.org/latest/omero/users/index.html'), - ('/info/OMERO.importer', 'https://docs.openmicroscopy.org/latest/omero/users/index.html'), - ('/info/OMERO.editor', 'https://docs.openmicroscopy.org/latest/omero/users/index.html'), - ('/info/OMERO.web', 'https://docs.openmicroscopy.org/latest/omero/users/index.html'), - ('/info/OMERO.server', 'https://docs.openmicroscopy.org/latest/omero/users/index.html'), - ('/info/permissions', 'https://docs.openmicroscopy.org/latest/omero/sysadmins/server-permissions.html'), + ('/info/OMERO.insight', 'https://docs.openmicroscopy.org/latest/omero/users/index.html'),# noqa + ('/info/OMERO.importer', 'https://docs.openmicroscopy.org/latest/omero/users/index.html'),# noqa + ('/info/OMERO.editor', 'https://docs.openmicroscopy.org/latest/omero/users/index.html'),# noqa + ('/info/OMERO.web', 'https://docs.openmicroscopy.org/latest/omero/users/index.html'),# noqa + ('/info/OMERO.server', 'https://docs.openmicroscopy.org/latest/omero/users/index.html'),# noqa + ('/info/permissions', 'https://docs.openmicroscopy.org/latest/omero/sysadmins/server-permissions.html'),# noqa ('/info/demo', 'http://help.openmicroscopy.org/demo-server.html'), ('/info/lists', 'http://lists.openmicroscopy.org.uk/mailman/listinfo/'), - ('/info/videos', 'https://www.youtube.com/channel/UCyySB9ZzNi8aBGYqcxSrauQ'), - ('/info/downgrade', 'https://docs.openmicroscopy.org/latest/omero/developers/Model/XsltTransformations.html'), - ('/info/flimfit', 'http://flimfit.org'), - ('/info/scripts', 'https://docs.openmicroscopy.org/latest/omero/developers/scripts/index.html'), - ('/info/bio-formats', 'https://docs.openmicroscopy.org/latest/bio-formats/'), - ('/info/slidebook', 'https://www.intelligent-imaging.com/technical-answers'), + ('/info/videos', 'https://www.youtube.com/channel/UCyySB9ZzNi8aBGYqcxSrauQ'),# noqa + ('/info/downgrade', 'https://docs.openmicroscopy.org/latest/omero/developers/Model/XsltTransformations.html'),# noqa + ('/info/flimfit', 'http://flimfit.org'),# noqa + ('/info/scripts', 'https://docs.openmicroscopy.org/latest/omero/developers/scripts/index.html'),# noqa + ('/info/bio-formats', 'https://docs.openmicroscopy.org/latest/bio-formats/'),# noqa + ('/info/slidebook', 'https://www.intelligent-imaging.com/technical-answers'),# noqa ] content_uris = [ ('/community', 'This page was generated by phpBB'), diff --git a/www/www-deploy.yml b/www/www-deploy.yml index ca75276a..29c9f2c1 100644 --- a/www/www-deploy.yml +++ b/www/www-deploy.yml @@ -1,6 +1,7 @@ # Install NGINX -- hosts: www +- name: Www deploy + hosts: www roles: - role: ome.ssl_certificate @@ -8,21 +9,23 @@ tags: nginxconf handlers: - - name: reload nginx + - name: Reload nginx listen: ssl certificate changed become: true - service: + ansible.builtin.service: name: nginx state: reloaded vars: - nginx_proxy_worker_processes: "{{ ((ansible_processor_count * ansible_processor_cores) / 2) |round|int }}" + nginx_proxy_worker_processes: >- + {{ ((ansible_processor_count * ansible_processor_cores) + / 2) |round|int }} nginx_proxy_worker_connections: 65000 - nginx_proxy_ssl: True + nginx_proxy_ssl: true nginx_proxy_ssl_certificate: "{{ ssl_certificate_bundled_path }}" nginx_proxy_ssl_certificate_key: "{{ ssl_certificate_key_path }}" - nginx_proxy_http2: True - nginx_proxy_force_ssl: False + nginx_proxy_http2: true + nginx_proxy_force_ssl: false nginx_proxy_404: "/404.html" nginx_proxy_conf_http: - "client_max_body_size 2g" @@ -32,309 +35,316 @@ server: https://www-legacy.openmicroscopy.org/qa2 - location: /static server: https://www-legacy.openmicroscopy.org - nginx_proxy_redirect_map_locations: # TODO: change to 301 when we're happy - - location: "~ ^/(BIO-FORMATS)($|/)" - code: 302 - - location: "~ ^/(OME-FILES)($|/)" - code: 302 - - location: "~ ^/(OMERO)($|/)" - code: 302 - - location: "~ ^/(site)($|/)" - code: 302 - - location: "~ ^/(omero-blog)($|/)" - code: 302 - - location: "~ ^/(info)($|/)" - code: 302 - - location: "~ ^/(forums)($|/)" - code: 302 - - location: "~ ^/(XMLschemas)($|/)" - code: 302 - - location: "~ ^/(Schemas/Samples)($|/)" - code: 302 - + - location: "~ ^/(BIO-FORMATS)($|/)" + code: 302 + - location: "~ ^/(OME-FILES)($|/)" + code: 302 + - location: "~ ^/(OMERO)($|/)" + code: 302 + - location: "~ ^/(site)($|/)" + code: 302 + - location: "~ ^/(omero-blog)($|/)" + code: 302 + - location: "~ ^/(info)($|/)" + code: 302 + - location: "~ ^/(forums)($|/)" + code: 302 + - location: "~ ^/(XMLschemas)($|/)" + code: 302 + - location: "~ ^/(Schemas/Samples)($|/)" + code: 302 nginx_proxy_redirect_map: # by default redirect to the 404 page - - match: default - dest: /404.html - - match: "~/omero-blog.*" - dest: http://blog.openmicroscopy.org - - match: "~/site/?$" - dest: / - - match: "~/site/news/?$" - dest: /announcements + - match: default + dest: /404.html + - match: "~/omero-blog.*" + dest: http://blog.openmicroscopy.org + - match: "~/site/?$" + dest: / + - match: "~/site/news/?$" + dest: /announcements - # about - - match: "~/site/about/?$" - dest: /about - - match: "~/site/about/who-ome" - dest: /teams - - match: "~/site/about/licensing" - dest: /licensing - - match: "~/site/about/licensing-attribution(/.*)?$" - dest: /licensing - - match: "~/site/about/ome-contributors/?$" - dest: /contributors - - match: "~/site/about/partners/?$" - dest: /commercial-partners - - match: "~/site/about/development-teams/?$" - dest: /teams - - match: "~/site/about/development-teams/glencoe-software" - dest: https://www.glencoesoftware.com/team.html - - match: "~/site/about/publications" - dest: /citing-ome - - match: "~/site/about/what-omero/overview" - dest: /omero - - match: "~/site/about/(?.*)$" - dest: /about + # about + - match: "~/site/about/?$" + dest: /about + - match: "~/site/about/who-ome" + dest: /teams + - match: "~/site/about/licensing" + dest: /licensing + - match: "~/site/about/licensing-attribution(/.*)?$" + dest: /licensing + - match: "~/site/about/ome-contributors/?$" + dest: /contributors + - match: "~/site/about/partners/?$" + dest: /commercial-partners + - match: "~/site/about/development-teams/?$" + dest: /teams + - match: "~/site/about/development-teams/glencoe-software" + dest: https://www.glencoesoftware.com/team.html + - match: "~/site/about/publications" + dest: /citing-ome + - match: "~/site/about/what-omero/overview" + dest: /omero + - match: "~/site/about/(?.*)$" + dest: /about - # products - - match: "~/site/products/?$" - dest: /products - - match: "~/site/products/omero/?$" - dest: /omero - - match: "~/site/products/omero/downloads/?$" - dest: /omero/downloads/ - - match: "~/site/products/omero/feature-list/?$" - dest: /omero/features/ - - match: "~/site/products/omero/big-images-support/?$" - dest: /omero/view/ - - match: "~/site/products/omero/secvuln/?$" - dest: /security/advisories/ - - match: "~/site/products/ome5/secvuln/?$" - dest: /security/advisories/ - - match: "~/site/products/omero/secvuln/(?.*[^/])/?$" - dest: /security/advisories/$link/ - - match: "~/site/products/bio-formats/?$" - dest: /bio-formats - - match: "~/site/products/bio-formats/downloads/?$" - dest: /bio-formats/downloads/ - - match: "~/site/products/ome-files-cpp/?$" - dest: /ome-files - - match: "~/site/products/(?.*)$" - dest: /products + # products + - match: "~/site/products/?$" + dest: /products + - match: "~/site/products/omero/?$" + dest: /omero + - match: "~/site/products/omero/downloads/?$" + dest: /omero/downloads/ + - match: "~/site/products/omero/feature-list/?$" + dest: /omero/features/ + - match: "~/site/products/omero/big-images-support/?$" + dest: /omero/view/ + - match: "~/site/products/omero/secvuln/?$" + dest: /security/advisories/ + - match: "~/site/products/ome5/secvuln/?$" + dest: /security/advisories/ + - match: "~/site/products/omero/secvuln/(?.*[^/])/?$" + dest: /security/advisories/$link/ + - match: "~/site/products/bio-formats/?$" + dest: /bio-formats + - match: "~/site/products/bio-formats/downloads/?$" + dest: /bio-formats/downloads/ + - match: "~/site/products/ome-files-cpp/?$" + dest: /ome-files + - match: "~/site/products/(?.*)$" + dest: /products - # community - - match: "~/forums/?$" - dest: https://forum.image.sc/c/data-management - - match: "~/site/community/?$" - dest: /support - - match: "~/site/community/mailing-lists/?$" - dest: /support - - match: "~/site/events(/.*)?$" - dest: /events - - match: "~/site/community/minutes/conference-calls/?$" - dest: /on-the-web - - match: "~/site/community/minutes/meetings/12th-annual-users-meeting-2017" - dest: /events/12th-annual-users-meeting-2017.html - - match: "~/site/community/minutes/meetings/11th-annual-users-meeting-2016" - dest: /events/11th-annual-users-meeting-2016.html - - match: "~/site/community/minutes/meetings/10th-annual-users-meeting-june-2015" - dest: /events/10th-annual-users-meeting-june-2015.html - - match: "~/site/community/minutes/meetings/9th-annual-users-meeting-june-2014" - dest: /events/9th-annual-users-meeting-june-2014.html - - match: "~/site/community/jobs/?$" - dest: /careers - - match: "~/site/community/scripts/?$" - dest: https://docs.openmicroscopy.org/latest/omero/developers/scripts/index.html - - match: "~/site/community/(?.*)$" - dest: /support + # community + - match: "~/forums/?$" + dest: https://forum.image.sc/c/data-management + - match: "~/site/community/?$" + dest: /support + - match: "~/site/community/mailing-lists/?$" + dest: /support + - match: "~/site/events(/.*)?$" + dest: /events + - match: "~/site/community/minutes/conference-calls/?$" + dest: /on-the-web + - match: "~/site/community/minutes/meetings\ + /12th-annual-users-meeting-2017" + dest: /events/12th-annual-users-meeting-2017.html + - match: "~/site/community/minutes/meetings\ + /11th-annual-users-meeting-2016" + dest: /events/11th-annual-users-meeting-2016.html + - match: "~/site/community/minutes/meetings/\ + 10th-annual-users-meeting-june-2015" + dest: /events/10th-annual-users-meeting-june-2015.html + - match: "~/site/community/minutes/meetings/\ + 9th-annual-users-meeting-june-2014" + dest: /events/9th-annual-users-meeting-june-2014.html + - match: "~/site/community/jobs/?$" + dest: /careers + - match: "~/site/community/scripts/?$" + dest: "https://docs.openmicroscopy.org/\ + latest/omero/developers/scripts/index.html" + - match: "~/site/community/(?.*)$" + dest: /support - # support - - match: "~/site/support/?$" - dest: /docs + # support + - match: "~/site/support/?$" + dest: /docs - - match: "~/site/support/bio-formats/?$" - dest: https://docs.openmicroscopy.org/latest/bio-formats/ - - match: "~/site/support/bio-formats/(?.*)$" - dest: https://docs.openmicroscopy.org/latest/bio-formats/$link - - match: "~/site/support/bio-formats5/?$" - dest: https://docs.openmicroscopy.org/latest/bio-formats5/ - - match: "~/site/support/bio-formats5/(?.*)$" - dest: https://docs.openmicroscopy.org/latest/bio-formats5/$link - - match: '~/site/support/bio-formats5\.3/?$' - dest: https://docs.openmicroscopy.org/latest/bio-formats5.3/ - - match: '~/site/support/bio-formats5\.3/(?.*)$' - dest: https://docs.openmicroscopy.org/latest/bio-formats5.3/$link - - match: '~/site/support/bio-formats5\.4/?$' - dest: https://docs.openmicroscopy.org/latest/bio-formats5.4/ - - match: '~/site/support/bio-formats5\.4/(?.*)$' - dest: https://docs.openmicroscopy.org/latest/bio-formats5.4/$link - - match: '~/site/support/bio-formats5\.5/?$' - dest: https://docs.openmicroscopy.org/latest/bio-formats5.5/ - - match: '~/site/support/bio-formats5\.5/(?.*)$' - dest: https://docs.openmicroscopy.org/latest/bio-formats5.5/$link + - match: "~/site/support/bio-formats/?$" + dest: https://docs.openmicroscopy.org/latest/bio-formats/ + - match: "~/site/support/bio-formats/(?.*)$" + dest: https://docs.openmicroscopy.org/latest/bio-formats/$link + - match: "~/site/support/bio-formats5/?$" + dest: https://docs.openmicroscopy.org/latest/bio-formats5/ + - match: "~/site/support/bio-formats5/(?.*)$" + dest: https://docs.openmicroscopy.org/latest/bio-formats5/$link + - match: '~/site/support/bio-formats5\.3/?$' + dest: https://docs.openmicroscopy.org/latest/bio-formats5.3/ + - match: '~/site/support/bio-formats5\.3/(?.*)$' + dest: https://docs.openmicroscopy.org/latest/bio-formats5.3/$link + - match: '~/site/support/bio-formats5\.4/?$' + dest: https://docs.openmicroscopy.org/latest/bio-formats5.4/ + - match: '~/site/support/bio-formats5\.4/(?.*)$' + dest: https://docs.openmicroscopy.org/latest/bio-formats5.4/$link + - match: '~/site/support/bio-formats5\.5/?$' + dest: https://docs.openmicroscopy.org/latest/bio-formats5.5/ + - match: '~/site/support/bio-formats5\.5/(?.*)$' + dest: https://docs.openmicroscopy.org/latest/bio-formats5.5/$link - - match: "~/site/support/omero/?$" - dest: https://docs.openmicroscopy.org/latest/omero/ - - match: "~/site/support/omero/(?.*)$" - dest: https://docs.openmicroscopy.org/latest/omero/$link - - match: "~/site/support/omero5/?$" - dest: https://docs.openmicroscopy.org/latest/omero5/ - - match: "~/site/support/omero5/(?.*)$" - dest: https://docs.openmicroscopy.org/latest/omero5/$link - - match: '~/site/support/omero5\.0/?$' - dest: https://docs.openmicroscopy.org/latest/omero5.0/ - - match: '~/site/support/omero5\.0/(?.*)$' - dest: https://docs.openmicroscopy.org/latest/omero5.0/$link - - match: '~/site/support/omero5\.1/?$' - dest: https://docs.openmicroscopy.org/latest/omero5.1/ - - match: '~/site/support/omero5\.1/(?.*)$' - dest: https://docs.openmicroscopy.org/latest/omero5.1/$link - - match: '~/site/support/omero5\.2/?$' - dest: https://docs.openmicroscopy.org/latest/omero5.2/ - - match: '~/site/support/omero5\.2/(?.*)$' - dest: https://docs.openmicroscopy.org/latest/omero5.2/$link - - match: '~/site/support/omero5\.3/?$' - dest: https://docs.openmicroscopy.org/latest/omero5.3/ - - match: '~/site/support/omero5\.3/(?.*)$' - dest: https://docs.openmicroscopy.org/latest/omero5.3/$link + - match: "~/site/support/omero/?$" + dest: https://docs.openmicroscopy.org/latest/omero/ + - match: "~/site/support/omero/(?.*)$" + dest: https://docs.openmicroscopy.org/latest/omero/$link + - match: "~/site/support/omero5/?$" + dest: https://docs.openmicroscopy.org/latest/omero5/ + - match: "~/site/support/omero5/(?.*)$" + dest: https://docs.openmicroscopy.org/latest/omero5/$link + - match: '~/site/support/omero5\.0/?$' + dest: https://docs.openmicroscopy.org/latest/omero5.0/ + - match: '~/site/support/omero5\.0/(?.*)$' + dest: https://docs.openmicroscopy.org/latest/omero5.0/$link + - match: '~/site/support/omero5\.1/?$' + dest: https://docs.openmicroscopy.org/latest/omero5.1/ + - match: '~/site/support/omero5\.1/(?.*)$' + dest: https://docs.openmicroscopy.org/latest/omero5.1/$link + - match: '~/site/support/omero5\.2/?$' + dest: https://docs.openmicroscopy.org/latest/omero5.2/ + - match: '~/site/support/omero5\.2/(?.*)$' + dest: https://docs.openmicroscopy.org/latest/omero5.2/$link + - match: '~/site/support/omero5\.3/?$' + dest: https://docs.openmicroscopy.org/latest/omero5.3/ + - match: '~/site/support/omero5\.3/(?.*)$' + dest: https://docs.openmicroscopy.org/latest/omero5.3/$link - - match: "~/site/support/ome-model/?$" - dest: https://docs.openmicroscopy.org/latest/ome-model/ - - match: "~/site/support/ome-model/(?.*)$" - dest: https://docs.openmicroscopy.org/latest/ome-model/$link - - match: "~/site/support/file-formats/?$" - dest: https://docs.openmicroscopy.org/latest/ome-model/ - - match: "~/site/support/file-formats/schemas/specifications/compliant-file-specification/?$" - dest: https://docs.openmicroscopy.org/latest/ome-model/specifications/ - - match: "~/site/support/ome-tiff/?$" - dest: https://docs.openmicroscopy.org/latest/ome-model/ome-tiff/ - - match: "~/site/support/ome-files-cpp/?$" - dest: https://docs.openmicroscopy.org/latest/ome-files-cpp/ - - match: "~/site/support/ome-files-cpp/(?.*)$" - dest: https://docs.openmicroscopy.org/latest/ome-files-cpp/$link - - match: "~/site/support/contributing/?$" - dest: https://docs.openmicroscopy.org/contributing/ - - match: "~/site/support/contributing/(?.*)$" - dest: https://docs.openmicroscopy.org/contributing/$link - - match: "~/site/support/previous(/.*)?$" - dest: https://docs.openmicroscopy.org - - match: "~/site/support/ome-artwork(/.*)?$" - dest: /artwork + - match: "~/site/support/ome-model/?$" + dest: https://docs.openmicroscopy.org/latest/ome-model/ + - match: "~/site/support/ome-model/(?.*)$" + dest: https://docs.openmicroscopy.org/latest/ome-model/$link + - match: "~/site/support/file-formats/?$" + dest: https://docs.openmicroscopy.org/latest/ome-model/ + - match: "~/site/support/file-formats/schemas\ + /specifications/compliant-file-specification/?$" + dest: https://docs.openmicroscopy.org/latest/ome-model/specifications/ + - match: "~/site/support/ome-tiff/?$" + dest: https://docs.openmicroscopy.org/latest/ome-model/ome-tiff/ + - match: "~/site/support/ome-files-cpp/?$" + dest: https://docs.openmicroscopy.org/latest/ome-files-cpp/ + - match: "~/site/support/ome-files-cpp/(?.*)$" + dest: https://docs.openmicroscopy.org/latest/ome-files-cpp/$link + - match: "~/site/support/contributing/?$" + dest: https://docs.openmicroscopy.org/contributing/ + - match: "~/site/support/contributing/(?.*)$" + dest: https://docs.openmicroscopy.org/contributing/$link + - match: "~/site/support/previous(/.*)?$" + dest: https://docs.openmicroscopy.org + - match: "~/site/support/ome-artwork(/.*)?$" + dest: /artwork - # uppercase alias - - match: "~/BIO-FORMATS$" - dest: /bio-formats - - match: "~/BIO-FORMATS/(?.*)$" - dest: /bio-formats/$link - - match: "~/OME-FILES$" - dest: /ome-files - - match: "~/OME-FILES/(?.*)$" - dest: /ome-files/$link - - match: "~/OMERO$" - dest: /omero - - match: "~/OMERO/(?.*)$" - dest: /omero/$link + # uppercase alias + - match: "~/BIO-FORMATS$" + dest: /bio-formats + - match: "~/BIO-FORMATS/(?.*)$" + dest: /bio-formats/$link + - match: "~/OME-FILES$" + dest: /ome-files + - match: "~/OME-FILES/(?.*)$" + dest: /ome-files/$link + - match: "~/OMERO$" + dest: /omero + - match: "~/OMERO/(?.*)$" + dest: /omero/$link - # info - - match: "~/info/vulnerabilities/?$" - dest: /security/advisories/ - - match: "~/info/vulnerabilities/(?.*[^/])/?$" - dest: /security/advisories/$link/ - - match: "~/info/omero/?$" - dest: /omero - - match: "~/info/OMERO.insight/?$" - dest: https://docs.openmicroscopy.org/latest/omero/users/index.html - - match: "~/info/OMERO.importer/?$" - dest: https://docs.openmicroscopy.org/latest/omero/users/index.html - - match: "~/info/OMERO.editor/?$" - dest: https://docs.openmicroscopy.org/latest/omero/users/index.html - - match: "~/info/OMERO.web/?$" - dest: https://docs.openmicroscopy.org/latest/omero/users/index.html - - match: "~/info/OMERO.server" - dest: https://docs.openmicroscopy.org/latest/omero/users/index.html - - match: "~/info/permissions" - dest: https://docs.openmicroscopy.org/latest/omero/sysadmins/server-permissions.html - - match: "~/info/demo" - dest: http://help.openmicroscopy.org/demo-server.html - - match: "~/info/cls" - dest: /omero/downloads/ - - match: "~/info/download" - dest: /omero/downloads/ - - match: "~/info/downloads" - dest: /omero/downloads/ - - match: "~/info/lists" - dest: http://lists.openmicroscopy.org.uk/mailman/listinfo/ - - match: "~/info/videos" - dest: https://www.youtube.com/channel/UCyySB9ZzNi8aBGYqcxSrauQ - - match: "~/info/attribution" - dest: /licensing/ - - match: "~/info/downgrade" - dest: https://docs.openmicroscopy.org/latest/omero/developers/Model/XsltTransformations.html - - match: "~/info/flimfit" - dest: http://flimfit.org - - match: "~/info/scripts" - dest: https://docs.openmicroscopy.org/latest/omero/developers/scripts/index.html - - match: "~/info/bio-formats(/.*)?$" - dest: https://docs.openmicroscopy.org/latest/bio-formats/ - - match: "~/info/slidebook" - dest: https://www.intelligent-imaging.com/technical-answers - - match: "~/info/(.*)?$" - dest: /site-map + # info + - match: "~/info/vulnerabilities/?$" + dest: /security/advisories/ + - match: "~/info/vulnerabilities/(?.*[^/])/?$" + dest: /security/advisories/$link/ + - match: "~/info/omero/?$" + dest: /omero + - match: "~/info/OMERO.insight/?$" + dest: https://docs.openmicroscopy.org/latest/omero/users/index.html + - match: "~/info/OMERO.importer/?$" + dest: https://docs.openmicroscopy.org/latest/omero/users/index.html + - match: "~/info/OMERO.editor/?$" + dest: https://docs.openmicroscopy.org/latest/omero/users/index.html + - match: "~/info/OMERO.web/?$" + dest: https://docs.openmicroscopy.org/latest/omero/users/index.html + - match: "~/info/OMERO.server" + dest: https://docs.openmicroscopy.org/latest/omero/users/index.html + - match: "~/info/permissions" + dest: "https://docs.openmicroscopy.org/latest\ + /omero/sysadmins/server-permissions.html" + - match: "~/info/demo" + dest: http://help.openmicroscopy.org/demo-server.html + - match: "~/info/cls" + dest: /omero/downloads/ + - match: "~/info/download" + dest: /omero/downloads/ + - match: "~/info/downloads" + dest: /omero/downloads/ + - match: "~/info/lists" + dest: http://lists.openmicroscopy.org.uk/mailman/listinfo/ + - match: "~/info/videos" + dest: https://www.youtube.com/channel/UCyySB9ZzNi8aBGYqcxSrauQ + - match: "~/info/attribution" + dest: /licensing/ + - match: "~/info/downgrade" + dest: "https://docs.openmicroscopy.org/latest/\ + omero/developers/Model/XsltTransformations.html" + - match: "~/info/flimfit" + dest: http://flimfit.org + - match: "~/info/scripts" + dest: "https://docs.openmicroscopy.org/latest/\ + omero/developers/scripts/index.html" + - match: "~/info/bio-formats(/.*)?$" + dest: https://docs.openmicroscopy.org/latest/bio-formats/ + - match: "~/info/slidebook" + dest: https://www.intelligent-imaging.com/technical-answers + - match: "~/info/(.*)?$" + dest: /site-map - # Legacy XMLschemas endpoint - - match: "~/XMLschemas/(?.*[^/])?$" - dest: /Schemas/$link + # Legacy XMLschemas endpoint + - match: "~/XMLschemas/(?.*[^/])?$" + dest: /Schemas/$link - # Legacy schemas samples - - match: - "~/Schemas/Samples/2013-06/bioformats-artificial/\ - multi-channel-4D-series.ome.tif.zip" - dest: - "https://downloads.openmicroscopy.org/images/OME-TIFF/\ - 2013-06/bioformats-artificial/multi-channel-4D-series.ome.tif" - - match: "~/Schemas/Samples/2015-01/set-1-meta-companion" - dest: - https://downloads.openmicroscopy.org/images/OME-TIFF/2015-01/companion/ - - match: - "~/Schemas/Samples/2015-01/bioformats-artificial/\ - multi-channel-time-series.ome.tif.zip" - dest: - "https://downloads.openmicroscopy.org/images/OME-TIFF/\ - 2015-01/bioformats-artificial/multi-channel-time-series.ome.tif" - - match: "~/Schemas/Samples/(?.*)?$" - dest: https://downloads.openmicroscopy.org/images/OME-TIFF/$link - - match: "~/Schemas/Samples" - dest: https://downloads.openmicroscopy.org/images/ + # Legacy schemas samples + - match: + "~/Schemas/Samples/2013-06/bioformats-artificial/\ + multi-channel-4D-series.ome.tif.zip" + dest: + "https://downloads.openmicroscopy.org/images/OME-TIFF/\ + 2013-06/bioformats-artificial/multi-channel-4D-series.ome.tif" + - match: "~/Schemas/Samples/2015-01/set-1-meta-companion" + dest: + https://downloads.openmicroscopy.org/images/OME-TIFF/2015-01/companion/ + - match: + "~/Schemas/Samples/2015-01/bioformats-artificial/\ + multi-channel-time-series.ome.tif.zip" + dest: + "https://downloads.openmicroscopy.org/images/OME-TIFF/\ + 2015-01/bioformats-artificial/multi-channel-time-series.ome.tif" + - match: "~/Schemas/Samples/(?.*)?$" + dest: https://downloads.openmicroscopy.org/images/OME-TIFF/$link + - match: "~/Schemas/Samples" + dest: https://downloads.openmicroscopy.org/images/ nginx_proxy_direct_locations: - - location: "/" - root: "/var/www/www.openmicroscopy.org/html" - index: index.html - - - location: "^~ /Schemas/Documentation/Generated/" - alias: /var/www/schemas_documentation/ + - location: "/" + root: "/var/www/www.openmicroscopy.org/html" + index: index.html - - location: "/Schemas/Transforms/" - root: "/var/www/www.openmicroscopy.org/html/" - custom: - - autoindex on + - location: "^~ /Schemas/Documentation/Generated/" + alias: /var/www/schemas_documentation/ - # Static copy of old phpBB forums: treat query params as part of filename - - location: "~ ^/community/style.php.*" - root: /var/www/phpbbforum/www.openmicroscopy.org - custom: - - try_files $request_uri $uri =404 - - default_type text/css - - location: "~ ^/community/?$" - redirect301: /community/index.php - - location: /community - root: /var/www/phpbbforum/www.openmicroscopy.org - custom: - # Need to exclude extra query parameters in incoming external links - # e.g. sid= - # If an exact match isn't found try just these parameters: - # [f, t, p], [f, t], [f] - - >- - try_files - $request_uri - $uri?f=$arg_f&t=$arg_t&p=$arg_p - $uri?f=$arg_f&t=$arg_t - $uri?f=$arg_f - =404 - - default_type text/html + - location: "/Schemas/Transforms/" + root: "/var/www/www.openmicroscopy.org/html/" + custom: + - autoindex on + # Static copy of old phpBB forums: treat query params as part of filename + - location: "~ ^/community/style.php.*" + root: /var/www/phpbbforum/www.openmicroscopy.org + custom: + - try_files $request_uri $uri =404 + - default_type text/css + - location: "~ ^/community/?$" + redirect301: /community/index.php + - location: /community + root: /var/www/phpbbforum/www.openmicroscopy.org + custom: + # Need to exclude extra query parameters in incoming external links + # e.g. sid= + # If an exact match isn't found try just these parameters: + # [f, t, p], [f, t], [f] + - >- + try_files + $request_uri + $uri?f=$arg_f&t=$arg_t&p=$arg_p + $uri?f=$arg_f&t=$arg_t + $uri?f=$arg_f + =404 + - default_type text/html -- include: www-static.yml +- name: Import www-static playbook + import_playbook: www-static.yml diff --git a/www/www-static.yml b/www/www-static.yml index 889a7124..f3c511c3 100644 --- a/www/www-static.yml +++ b/www/www-static.yml @@ -1,74 +1,82 @@ # Update the static website -- hosts: www +- name: Www static + hosts: www pre_tasks: - - name: Check if phpbbforum already unzipped - stat: - path: "{{ phpbbforum_style_file }}" - register: _phpbbforum_style_file_st + - name: Check if phpbbforum already unzipped + ansible.builtin.stat: + path: "{{ phpbbforum_style_file }}" + register: _phpbbforum_style_file_st - - name: Check if schemas_documentation already unzipped - stat: - path: "{{ schemas_doc_file }}" - register: _schemas_doc_file_st + - name: Check if schemas_documentation already unzipped + ansible.builtin.stat: + path: "{{ schemas_doc_file }}" + register: _schemas_doc_file_st roles: - - role: ome.deploy_archive - become: yes - deploy_archive_dest_dir: /var/www - deploy_archive_src_url: https://downloads.openmicroscopy.org/web-archive/phpbbforum-20190718.tar.gz - deploy_archive_sha256: e9d7a7eefbacf42ddbdf92b201584913cb6d94ec331750f811232b2e91aa5b40 - # This file is patched later so only unzip if it doesn't exist - when: not _phpbbforum_style_file_st.stat.exists + - role: ome.deploy_archive + become: true + deploy_archive_dest_dir: /var/www + deploy_archive_src_url: "https://downloads.openmicroscopy.org/web-\ + archive/phpbbforum-20190718.tar.gz" + deploy_archive_sha256: "e9d7a7eefbacf42ddbdf92b201584913cb6d94ec\ + 331750f811232b2e91aa5b40" + # This file is patched later so only unzip if it doesn't exist + when: not _phpbbforum_style_file_st.stat.exists - - role: ome.deploy_archive - become: yes - deploy_archive_dest_dir: /var/www - deploy_archive_src_url: https://downloads.openmicroscopy.org/web-archive/schemas_documentation-20211213.tar.gz - deploy_archive_sha256: 27cc5def458112a2e259484906f2bc8c0e0e2bd0a728b0a478302537d67117ec - # This file is patched later so only unzip if it doesn't exist - when: not _schemas_doc_file_st.stat.exists + - role: ome.deploy_archive + become: true + deploy_archive_dest_dir: /var/www + deploy_archive_src_url: "https://downloads.openmicroscopy.org/web-\ + archive/schemas_documentation-20211213.tar.gz" + deploy_archive_sha256: "27cc5def458112a2e259484906f2bc8c0e0e2bd\ + 0a728b0a478302537d67117ec" + # This file is patched later so only unzip if it doesn't exist + when: not _schemas_doc_file_st.stat.exists tasks: - - name: install deployment script - become: yes - template: - src: files/deploy - dest: /usr/local/bin/deploy - mode: 0555 + - name: Install deployment script + become: true + template: + src: files/deploy + dest: /usr/local/bin/deploy + mode: 0555 - - name: Install Cron daemon - become: yes - yum: - name: cronie - state: installed + - name: Install Cron daemon + become: true + ansible.builtin.yum: + name: cronie + state: installed - - name: Add cron job updating the website - become: yes - cron: - name: "Deploy the website" - special_time: hourly - job: "/usr/local/bin/deploy 2>&1 > /dev/null || /usr/local/bin/deploy -f" + - name: Add cron job updating the website + become: true + ansible.builtin.cron: + name: "Deploy the website" + special_time: hourly + job: >- + /usr/local/bin/deploy 2>&1 > + /dev/null || /usr/local/bin/deploy -f - - name: Update static phpbb stylesheet - become: yes - blockinfile: - block: | - form, - .quick-login, - .buttons, - #jumpbox~h3, - #jumpbox~p, - .headerspace~h3, - .headerspace~p, - ul.linklist.rightside, - ul.linklist li.rightside { - display: none; - } - marker: "/* {mark} ANSIBLE MANAGED BLOCK */" - path: "{{ phpbbforum_style_file }}" + - name: Update static phpbb stylesheet + become: true + ansible.builtin.blockinfile: + block: | + form, + .quick-login, + .buttons, + #jumpbox~h3, + #jumpbox~p, + .headerspace~h3, + .headerspace~p, + ul.linklist.rightside, + ul.linklist li.rightside { + display: none; + } + marker: "/* {mark} ANSIBLE MANAGED BLOCK */" + path: "{{ phpbbforum_style_file }}" vars: - phpbbforum_style_file: "/var/www/phpbbforum/www.openmicroscopy.org/community/style.php?id=7&lang=en" + phpbbforum_style_file: "/var/www/phpbbforum/www.openmicroscopy\ + .org/community/style.php?id=7&lang=en" schemas_doc_file: "/var/www/schemas_documentation/OME-2016-06/ome.html"