-
Notifications
You must be signed in to change notification settings - Fork 18
ome-dundeeomero next steps / cleanup #273
ome-dundeeomero next steps / cleanup #273
Conversation
Full playbook run of 'nightshade-web' tested on a test system (infra-testpr), installs from pypi omero-figure and FPBioimage viewer. |
NFS remote processing mount added to playbook and deployed on live system. Tested working. |
@joshmoore - note the addition of an |
If any @openmicroscopy/devops would like to have a look-over that'd be good. I merged to document the changes made to the live system, to continue work on the |
- reload systemd | ||
# Set desired state of webapps (upgrade v.s. install/keep current version) | ||
- set_fact: | ||
webapps_state: present |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI set_fact
will set a host-var that may persist across playbooks in the same ansible-playbook
command, so there's a (small) danger of inadvertent variable conflicts, especially with shorter names and more complex deployments. Since this var is only used in one place you could get rid of it completely and in name: Omero.web plugins | plugin install via pip & pypi
have state: "{{ webapps_state | default('present') }}"
, and pass -e webapps_state=latest
on the command line to upgrade.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep - thanks, I couldn't find how to do make that conditional just work, without registering the fact. I read that indeed it would persist, so made sure to initialise it first with no conditional to present
. Thanks for the syntax, and I'll refactor this as you suggest.
no_log: true | ||
|
||
# This to be refactored for RHEL/non-spacewalk at some point |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you refactor I can think of two options:
- Install/configure
openmicroscopy.system-monitor-agent
in each server's playbook as at present - Remove all mentions of
openmicroscopy.system-monitor-agent
in individual playbooks and have a single site-wide playbook that handles internal monitoring on all servers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've found a better way which will work with RHEL/non-spacewalk servers - by checking for the SLS nameservers in the networking config - this was introduced on the ome-dundeeomero
work and continues. These are good ideas for further refactoring though, so thank you.
# Clean the files from the folder-format dump directory | ||
rm {{ omero_server_db_dumpdir_parent }}/{{ omero_server_db_dumpdir_name }}/* | ||
# Create a fresh db dump | ||
sudo -u postgres pg_dump -j {{ (ansible_processor_count * ansible_processor_cores) |round|int }} -Fd -f {{ omero_server_db_dumpdir_parent }}/{{ omero_server_db_dumpdir_name }} {{ vault_omero_server_dbname }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need |round|int
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jinja2 was creating doubles - or certainly values with a decimal point, which at least nginx did not appreciate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- name: PostgreSQL Nightly Backups | Create the backups directory | ||
become: yes | ||
file: | ||
path: "{{ omero_server_db_dumpdir_parent }}/{{ omero_server_db_dumpdir_name }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor point, the omero_server_
prefix is used by the omero-server role, so there's potential for confusion between vars specific to this playbook and those in the role.
@@ -11,6 +11,27 @@ | |||
((ansible_virtualization_type is defined) | |||
and (ansible_virtualization_type == "VMware")) | |||
|
|||
# Not required for an OMERO server install - UoD specific implementation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does https://galaxy.ansible.com/openmicroscopy/nfs-mount/ work for this mount?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure, didn't see/try it. What is there just now certainly worked.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough, but that's certainly the point of the reviews is so that we express to the next person coming along here's how we think it should be done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed - I definitely do see the value of these reviews - I didn't skip review because I thought otherwise - rather to progress ome-demoserver
and have all my ansible code in one (new) branch such that I could diff / merge from my previous code.
@@ -1,35 +1,16 @@ | |||
# Install OMERO.web with a public user on localhost | |||
# Pass the command line 'upgrade-webapps' flag to upgrade webapps |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my later comment, but if you want to keep it as it is there's a typo: _
not -
@@ -2,7 +2,23 @@ | |||
# Add web-extension OMERO.web configuration | |||
# after web already installed and running via role | |||
|
|||
config set -- omero.web.apps '["figure"]' | |||
config set -- omero.web.ui.top_links '[["Data", "webindex", {"title": "Browse Data via Projects, Tags etc"}], ["History", "history", {"title": "History"}], ["Help", "http://help.openmicroscopy.org/", {"target": "new", "title": "Open OMERO user guide in a new tab"}], ["Figure", "figure_index", {"target": "new", "title": "Open OMERO.Figure in a new tab"}] ]' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor point: there's no templating in this file (apart from ansible_managed
) so it could be a normal file and copy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My 2c: I don't mind all files being templates.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It certainly helps when merging >1 playbook with some plain copies and some templating. A 'file' is a template which just doesn't change very much?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, unless you have a string that contains {{
or {%
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good tip, thanks.
@@ -42,18 +23,35 @@ | |||
lvm_lvfilesystem: "{{ provision_root_filesystem }}" | |||
|
|||
# OMERO.web configuration in host_vars in different repository |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So omero_web_config_set
is in hostvars, but omero_server_config_set
is in ome-dundeeomero/playbook.yml
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I became more confident with the Ansible, I realised I could define the vars in the playbook, and keep as much as possible public, only pulling the individual private variables from private config. Initially I thought I'd have to keep the whole omero_web_config_set
together as one. ome-dundeeomero
represents my having learned that lesson. A refactor of the ns-web playbook would be nice, in this style.
Next steps and cleanup for the New Nightshade server pair.