Skip to content

Commit

Permalink
Add demo playbook and requirements file from private repo
Browse files Browse the repository at this point in the history
  • Loading branch information
pwalczysko committed Aug 26, 2024
1 parent adc782f commit 4b78c8f
Show file tree
Hide file tree
Showing 3 changed files with 174 additions and 250 deletions.
290 changes: 147 additions & 143 deletions omero/ome-demoserver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,106 +8,105 @@
pre_tasks:
- name: Install open-vm-tools if system is a VMware vm
become: true
ansible.builtin.yum:
ansible.builtin.dnf:
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/
# to make some of the variables non-required.
- name: Resize root FS without altering mount options
tags: lvm
become: true
lvol:
lv: root
vg: VolGroup00
size: "{{ provision_root_lvsize }}"
shrink: false

- name: Install Make Movie script Prerequisite | MEncoder - Repo
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: true
ansible.builtin.yum:
name: mencoder
state: present

- name: Server-side script prerequisites
become: true
ansible.builtin.yum:
name: "{{ item }}"
state: present
with_items:
- mencoder # For the 'make movie' script
# # 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: true
# lvol:
# lv: root
# vg: VolGroup00
# size: "{{ provision_root_lvsize }}"
# shrink: false

# - name: Install Make Movie script Prerequisite | MEncoder - Repo
# 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: true
# ansible.builtin.yum:
# name: mencoder
# state: present

# - name: Server-side script prerequisites
# become: true
# ansible.builtin.yum:
# name: "{{ item }}"
# state: present
# with_items:
# - mencoder # For the 'make movie' script

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.system_monitor_agent
# tags: monitoring
# when: "'10.1.255.216' in ansible_dns.nameservers"

# Disk Layout - PostgreSQL | data dir on separate VG (SSD)
- role: ome.lvm_partition
tags: lvm
lvm_lvname: pgdata
lvm_vgname: "{{ provision_postgres_vgname }}"
lvm_lvmount: /var/lib/pgsql
lvm_lvsize: "{{ provision_postgres_lvsize }}"
lvm_lvfilesystem: "{{ filesystem }}"
lvm_shrink: false

# Disk Layout - OMERO | VG and LV (separate disk) for Binary Repository
- role: ome.lvm_partition
tags: lvm
lvm_lvname: datadir
lvm_vgname: "{{ provision_omero_server_datadir_vgname }}"
lvm_lvmount: "{{ omero_server_datadir }}"
lvm_lvsize: "{{ provision_omero_server_datadir_lvsize }}"
lvm_lvfilesystem: "{{ filesystem }}"
lvm_shrink: false

# Disk Layout - OMERO.server | LV for dist & logs
- role: ome.lvm_partition
tags: lvm
lvm_lvname: omero_server_basedir
lvm_vgname: VolGroup00
lvm_lvmount: "{{ omero_server_basedir }}"
lvm_lvsize: "{{ provision_omero_server_basedir_lvsize }}"
lvm_lvfilesystem: "{{ filesystem }}"
lvm_shrink: false

# Disk Layout - OMERO.web | LV for dist & logs
- role: ome.lvm_partition
tags: lvm
lvm_lvname: omero_web_basedir
lvm_vgname: VolGroup00
lvm_lvmount: "{{ omero_web_basedir }}"
lvm_lvsize: "{{ provision_omero_web_basedir_lvsize }}"
lvm_lvfilesystem: "{{ filesystem }}"
lvm_shrink: false

- role: ome.nginx
nginx_version: 1.16.1
# - role: ome.lvm_partition
# tags: lvm
# lvm_lvname: pgdata
# lvm_vgname: "{{ provision_postgres_vgname }}"
# lvm_lvmount: /var/lib/pgsql
# lvm_lvsize: "{{ provision_postgres_lvsize }}"
# lvm_lvfilesystem: "{{ filesystem }}"
# lvm_shrink: false

# # Disk Layout - OMERO | VG and LV (separate disk) for Binary Repository
# - role: ome.lvm_partition
# tags: lvm
# lvm_lvname: datadir
# lvm_vgname: "{{ provision_omero_server_datadir_vgname }}"
# lvm_lvmount: "{{ omero_server_datadir }}"
# lvm_lvsize: "{{ provision_omero_server_datadir_lvsize }}"
# lvm_lvfilesystem: "{{ filesystem }}"
# lvm_shrink: false

# # Disk Layout - OMERO.server | LV for dist & logs
# - role: ome.lvm_partition
# tags: lvm
# lvm_lvname: omero_server_basedir
# lvm_vgname: VolGroup00
# lvm_lvmount: "{{ omero_server_basedir }}"
# lvm_lvsize: "{{ provision_omero_server_basedir_lvsize }}"
# lvm_lvfilesystem: "{{ filesystem }}"
# lvm_shrink: false

# # Disk Layout - OMERO.web | LV for dist & logs
# - role: ome.lvm_partition
# tags: lvm
# lvm_lvname: omero_web_basedir
# lvm_vgname: VolGroup00
# lvm_lvmount: "{{ omero_web_basedir }}"
# lvm_lvsize: "{{ provision_omero_web_basedir_lvsize }}"
# lvm_lvfilesystem: "{{ filesystem }}"
# lvm_shrink: false

# nginx_version: 1.16.1

- role: ome.postgresql
# no_log: true
postgresql_databases:
- name: omero
- name: omero
owner: demo
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: []

- role: ome.omero_server
# Defaults overridden in private configuration
Expand All @@ -117,15 +116,17 @@
omero_server_dbname: omero
omero_server_systemd_limit_nofile: 16384

- role: ome.nginx

- role: ome.omero_web
# Defaults overridden in private configuration
omero_web_systemd_limit_nofile: 16384
omero_web_python_addons:
- "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-autotag=={{ omero_autotag_release }}"
- "omero-tagsearch==\
{{ omero_tagsearch_release }}"
- "omero-iviewer=={{ omero_iviewer_release }}"
- "omero-parade=={{ omero_parade_release }}"
- "omero-signup=={{ omero_signup_release }}"
Expand Down Expand Up @@ -156,7 +157,6 @@
postgresql_backup_compress: true
postgresql_backup_dir: /OMERO/pgbackup
postgresql_backup_filename_format: "nightly-omero-%a.pgdump.gz"
postgresql_backup_minimum_expected_size: 100000000

handlers:
- name: Reload web server
Expand All @@ -168,6 +168,10 @@

post_tasks:

- name: Allow nginx to connect to omero-web
become: yes
command: setsebool -P httpd_can_network_connect on

- name: NGINX - Performance tuning - worker processes
become: true
ansible.builtin.replace:
Expand Down Expand Up @@ -256,50 +260,50 @@
- restart omero-web
no_log: true

- name: Check_MK postgres plugin | check for plugin existence
tags: monitoring
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: 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
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
# - name: Check_MK postgres plugin | check for plugin existence
# tags: monitoring
# 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: 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
# 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

- name: PostgreSQL Nightly Backups | Remove old cron job
become: true
Expand Down Expand Up @@ -332,26 +336,26 @@

vars:
omero_figure_release: >-
{{ omero_figure_release_override | default('6.0.1') }}
{{ omero_figure_release_override | default('6.2.2') }}
omero_figure_script_release: >-
{{ omero_figure_script_release_override | default('v6.0.1') }}
{{ omero_figure_script_release_override | default('v6.2.2') }}
omero_fpbioimage_release: >-
{{ omero_fpbioimage_release_override | default('0.4.1') }}
omero_iviewer_release: >-
{{ omero_iviewer_release_override | default('0.13.0') }}
{{ omero_iviewer_release_override | default('0.14.0') }}
omero_parade_release: >-
{{ omero_parade_release_override | default('0.2.4') }}
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_autotag_release: >-
{{ omero_autotag_release_override | default('4.0.1') }}
omero_tagsearch_release: >-
{{ omero_tagsearch_release_override | default('4.1.1') }}
omero_signup_release: >-
{{ omero_signup_release_override | default('0.3.2') }}
{{ omero_signup_release_override | default('0.3.3') }}
omero_server_release: >-
{{ omero_server_release_override | default('5.6.8') }}
omero_web_release: "{{ omero_web_release_override | default('5.22.1') }}"
omero_py_release: "{{ omero_py_release_override | default('5.15.0') }}"
{{ omero_server_release_override | default('5.6.11') }}
omero_web_release: "{{ omero_web_release_override | default('5.26.0') }}"
omero_py_release: "{{ omero_py_release_override | default('5.19.2') }}"
# For https://github.com/openmicroscopy/ansible-role-java,
# which is a dependency.
java_jdk_install: true
Expand Down Expand Up @@ -388,7 +392,7 @@
[1] In your browser, go to omero-guides.readthedocs.io/en/latest
and click on OMERO walkthrough example under Getting started.'
postgresql_version: "11"
postgresql_version: "16"
filesystem: "xfs"

omero_server_config_set:
Expand Down Expand Up @@ -445,7 +449,7 @@
omero.web.wsgi_workers: >-
{{ (2 * (ansible_processor_count *
ansible_processor_cores)) + 1 }}
omero.web.admins: "{{ omero_web_admins }}"
# 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:
Expand Down
Loading

0 comments on commit 4b78c8f

Please sign in to comment.