-
Notifications
You must be signed in to change notification settings - Fork 19
Conversation
This version run yesterday to provision ns-web-vm. LS27172:nightshade-web kenny$ echorun ansible-playbook -l ns-web.openmicroscopy.org -i ~/Forks/management_tools/ansible/inventory/prod-hosts --ask-become-pass playbook.yml | tee ns-web-provision_$(date -u +"%Y%m%d-%H%M%SZ").log Run: Run (after removing yum exclusions for check-mk): |
This version run a few minutes ago, installing SSL config and certificate.
Dependent config in private repo https://github.com/openmicroscopy/management_tools/pull/352 ns-web-provision_20170407-154123Z.txt https://ns-web.openmicroscopy.org/webgateway/img_detail/3933597/ |
(temporary) manual configuration of ns-web performed installs the web-extensions to bring ns-web to feature parity with Nightshade. Server ready for testing. Not added to the playbook, as it's changes that won't be necessary with 5.3.0. Can be added later if required. |
Now added the 'manual' install steps for figure and webtagging, as mentioned in #255 (comment), as I want to use the Ansible to push more config settings, so require it to continue to work. |
|
||
handlers: | ||
|
||
# Handler for nginx |
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.
The omero-common
role already includes a set of useful handlers, you should be able to use that instead of redefining one here.
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 didn't realise I could use things defined 'underneath' the playbook when I wrote that. From programming, I wouldn't have expected global scope for defined functions like that. I subsequently used e.g. the 'restart systemd' handler too, so you can see I learned, but didn't strip the original nginx one from the playbook.
destfile: /etc/systemd/system/omero-web.service.d/pythonpath.conf | ||
owner: "root" | ||
group: "root" | ||
block: |2+ |
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.
Do you need the fancy formatting provided by |2+
? Will just plain |
do?
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 couldn't make it work any other way, so leaving it as 'this works'. Other options failed completely with errors, or didn't give the indenting in the destination. I am pretty new to YAML and the whitespace significance, though.
file: | ||
path: "{{ omero_web_extensionsdir }}" | ||
state: directory | ||
owner: "{{ omero_web_system_user }}" |
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 this directory need to be writeable by the web user? And similarly for the tasks below.
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, but this works, and it's how it's set up elsewhere. If you've another suggestion, happy to hear it.
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.
Make it owned by root unless you have reason to believe OMERO.web needs write access to its code.
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.
Let's try it.
template: | ||
src: templates/omero-web-config-for-webapps.j2 | ||
dest: "{{ omero_web_basedir }}/config/omero-web-config-for-webapps.omero" | ||
owner: "{{ omero_web_system_user }}" |
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 this need to be writeable by web?
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.
Set now to root:root
.
group: "{{ omero_web_system_user }}" | ||
mode: "u=rw,go=r" | ||
notify: | ||
- omero-web restart omero-web |
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.
Can you use the handler from omero-common restart omero-web
instead of the one embedded in the omero-web role which was intended for internal use by the role?
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 just grep -R restart *
and found this in use elsewhere and having learned it's possible to re-use them, I used it. I can try.
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, seems to work
changed: [infra-testpr.openmicroscopy.org]
RUNNING HANDLER [openmicroscopy.omero-common : restart omero-web] **************
changed: [infra-testpr.openmicroscopy.org]
PLAY RECAP *********************************************************************
infra-testpr.openmicroscopy.org : ok=3 changed=2 unreachable=0 failed=0
|
||
config set -- omero.web.apps '["autotag", "tagsearch", "figure"]' | ||
config set -- omero.web.ui.center_plugins '[["Auto Tag", "autotag/auto_tag_init.js.html", "auto_tag_panel"]]' | ||
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"}], ["Tag Search", "tagsearch"]]' |
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 significant templated variables in here, so it could be a plain file (task copy
instead of a template
)
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.
👍 will consider it for next time.
Current 7003b1e successfully working on
|
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.
A couple of non-blocker comments. Looks good to me.
owner="{{ item.value.owner }}" | ||
group="{{ item.value.group }}" | ||
mode="{{ item.value.mode }}" | ||
with_dict: "{{ nginx_ssl_cert_files }}" |
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.
with_dict
looks a bit weird here, though I haven't seen the actual variable.
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.
@manics - see https://dantehranian.wordpress.com/2015/07/24/managing-secrets-with-ansible-vault-the-missing-guide-part-1-of-2/ - it's exactly like this example.
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.
OK, looks overly complicated since the owner/group/mode don't vary
- name: OMERO.web apps | download latest figure | ||
become: yes | ||
unarchive: | ||
src: https://downloads.openmicroscopy.org/latest/figure.zip |
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.
For full reproducibility you should use the versioned zip https://downloads.openmicroscopy.org/figure/1.2.1/figure-1.2.1.zip since you've got creates: "{{ omero_web_extensionsdir }}/figure-{{omero_web_extensions_figure_ver}}"
below
--- | ||
|
||
- name: openmicroscopy.omero-common | ||
src: https://github.com/openmicroscopy/ansible-role-omero-common.git |
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.
Remember to add versions once these have been tagged.
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 workaround in ome/pydoop-features@fec18e1 until we have tags being properly pushed to galaxy again (ansible/galaxy-issues#252)
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.
Alternatively since you've got git installed on the machine that's running Ansible you can just add version: X.X.X
, e.g. IDR/deployment@d74d7c3
The main advantage of ome/pydoop-features@fec18e1 is you don't need to install git.
ns-web reset to 'post provision' snapshot, and redeployed this playbook at current version, combined with private config at 11901be ns-web-provision_20170412-173859Z.txt |
…iply with #processors to get total cores
re-ran with updated 'total cores' math (matching private config https://github.com/openmicroscopy/management_tools/pull/352/commits/9292f47b294acb09d6e043fe626ae45237357113) ns-web-provision_20170413-101658Z.txt
|
Deployment of https://trello.com/c/vxPG2L3a/714-new-nightshade-web-vm
Configuration in management tools at https://github.com/openmicroscopy/management_tools/pull/352
Still in development