This repository has been archived by the owner on Jun 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
Get the IDR playbooks working smoothly with multiple deployments #124
Merged
Merged
Changes from 24 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
adbf3d9
add packages needed for selinux setup
hajaalin fc1756a
Add {{ idr_environment }} as prefix to idr host groups
manics 5e79af7
Use custom IDR OMERO 0.0.7-rc1 build for IDR servers
manics 6fe0f2c
Prefix all idr vms with idr_environment
manics 920a926
Prefix idr VMs in os-idr-ebi.yml
manics b11bb80
Update readme (still needs full testing)
manics 1c92012
Remove idr-playbooks/idr-user-utils.yml
manics 5260a71
install basedeps with basedeps_user_utils
manics fb2e405
Remove upgrade-distpackages from idr-omero.yml
manics c1a9e37
Use long-form for roles
manics 6c703f8
Update README.md with latest openstack ansible changes
manics ccf05ec
Change default public config pass to public
manics 265704f
Openstack only playbook for setting up volumes from inside the VM
manics 916a3a7
Add a generic {{}}-data-hosts groupo to os-idr-volumes.yml
manics 18d7869
Add a role for managing the IDR Openstack security groups
manics ba7eafd
Add role for creating single IDR VMs
manics 1f703ca
Install cli-utils on omero
manics 8a0272f
Add docker groups to openstack-idr-instance
manics b0bd052
Remove http/s ports from idr-omero-external
manics 4af7da5
Optional snapshot source for openstack-volume-storage
manics c135ef4
Don't set nginx_proxy_set_header_host
manics 0db2aef
Add os-idr-create-example.yml which uses the new openstack-idr roles
manics ace19c1
update readme
manics 6330304
Add a placeholder for copy-from-volume
manics 53b10c8
Remove omero_upgrade: True from idr group_vars
manics File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,84 +10,67 @@ Most of these scripts should also work on other platforms, providing the VM is b | |
The guest must be running CentOS 7. | ||
|
||
|
||
Guide for the Impatient | ||
----------------------- | ||
Openstack: Creation of instances, volumes and security groups | ||
------------------------------------------------------------- | ||
|
||
Setup your OpenStack environment variables, and run: | ||
[Setup your OpenStack environment variables](http://docs.openstack.org/user-guide/common/cli_set_environment_variables_using_openstack_rc.html), edit the variables in `os-idr-playbooks/os-idr-create-example.yml` (especially `idr_vm_keyname` and `idr_environment`), then run: | ||
|
||
ansible-playbook -i inventory -e omero_vm_name=FOO -e omero_vm_key_name=YOUR_KEY os-idr-uod.yml | ||
ansible-playbook os-idr-playbooks/os-idr-create-example.yml | ||
|
||
|
||
`os-idr-playbooks/os-omero.yml` | ||
------------------------------- | ||
|
||
This is the Ansible playbook that will be run to setup OMERO. | ||
You can also run it manually to install OMERO on localhost. | ||
|
||
|
||
`os-idr-playbooks/os-create.yml` | ||
-------------------------------- | ||
Openstack: Installing the IDR | ||
----------------------------- | ||
|
||
This playbook will connect to OpenStack and spin up a VM. | ||
The Ansible modules in this playbook require the `shade` Python module. | ||
Find the floating IP of the proxy/bastion server. | ||
Set `BASTION_IP` to the IP, and `IDR_ENVIRONMENT` to match the value from above. | ||
Run: | ||
|
||
Before running the playbook you must [setup your OpenStack environment variables](http://docs.openstack.org/user-guide/common/cli_set_environment_variables_using_openstack_rc.html). | ||
You can override variables at the command line, for example (note double quoting is necessary if spaces are present): | ||
BASTION_IP=10.0.0.0 | ||
IDR_ENVIRONMENT=idr | ||
ansible-playbook \ | ||
-i inventory/openstack-private.py \ | ||
-u centos \ | ||
-e idr_environment=$IDR_ENVIRONMENT \ | ||
-e idr_nginx_ssl_self_signed=True \ | ||
-e ansible_ssh_common_args="'-o ProxyCommand=\\\"ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -W %h:%p -q centos@$BASTION_IP\\\" -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'" \ | ||
idr-playbooks/os-idr-volumes.yml \ | ||
idr-playbooks/idr-dundee-nfs.yml \ | ||
idr-playbooks/idr-ebi-nfs.yml \ | ||
idr-playbooks/idr.yml \ | ||
idr-playbooks/idr-docker.yml | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doesn't exist (yet?) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. True...that's in my other branch There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
ansible-playbook os-idr-playbooks/os-create.yml -e omero_vm_name=FOO \ | ||
-e omero_vm_key_name=YOURKEY -e "omero_vm_flavour='m2.xxlarge'" | ||
|
||
If this step fails it could be due to an incorrect variable, the Ansible `os_server` module usually gives an uninformative "Error in creating instance" message. | ||
If the VM was created the floating IP of the VM will be printed out. | ||
Deploying the IDR on existing infrastructure | ||
-------------------------------------------- | ||
|
||
To delete the VM and related security group: | ||
If you have already created your servers and just wish to install a plain IDR then run: | ||
|
||
ansible-playbook os-idr-playbooks/os-delete.yml -e omero_vm_name=FOO | ||
ansible-playbook \ | ||
-i inventory \ | ||
-u centos \ | ||
-e idr_environment=$IDR_ENVIRONMENT \ | ||
-e idr_nginx_ssl_self_signed=True \ | ||
idr-playbooks/idr-omero.yml | ||
|
||
If another instance is using the OMERO security group, the task will fail but can be safely ignored. | ||
where `inventory` contains groups described in the following section. | ||
|
||
|
||
Inventory | ||
--------- | ||
`idr-playbooks/idr-omero.yml` | ||
----------------------------- | ||
|
||
This directory takes advantage of an | ||
[Ansible dynamic inventory script for OpenStack (`openstack.py`)](http://docs.ansible.com/ansible/intro_dynamic_inventory.html#example-openstack-external-inventory-script) | ||
instead of having to manage an inventory file when using Ansible to push out changes. | ||
For example: | ||
This is the Ansible playbook that will be run to setup OMERO. | ||
This can be run independently of the openstack playbooks providing you have an inventory with groups: | ||
- `{{ idr_environment }}-data-hosts` | ||
- `{{ idr_environment }}-omero-hosts` | ||
- `{{ idr_environment }}-proxy-hosts` | ||
|
||
ansible-playbook -i inventory -l os-image-centos os-idr-playbooks/os-omero.yml -vv | ||
|
||
Variables for the groups defined in `os-idr-playbooks/os-create.yml` as `omero_vm_groups` can be added under inventory/variables. | ||
TODO: explain other `idr-playbooks/*.yml` playbooks | ||
|
||
|
||
Deploying the IDR | ||
================= | ||
|
||
|
||
The production IDR is setup using a private configuration repository. | ||
Replace `{{ inventory_dir }}` with the path to the inventory directory. | ||
You can use `inventory` in this directory if you have configured the required variables, such as by creating a group_vars file if necessary in `{{ inventory_dir }}/group_vars/`, e.g. `{{ inventory_dir }}/group_vars/os-idr.yml` | ||
This should match the value of the `idr_environment` variable (default `os-idr`), and can be used to support multiple deployment environments with different variables. | ||
|
||
Decide on your openstack dynamic inventory. | ||
If you are using a single floating IP use `{{ inventory_dir }}/openstack-private.py`. | ||
using private internal IPs and a gateway server on the Openstack cloud. | ||
If you are using floating IPs for all instances you can optionally use `{{ inventory_dir }}/openstack.py` instead. | ||
|
||
Select your playbook, for instance `os-idr-uod.yml` for the Dundee cloud. | ||
|
||
For example (using the default `os-idr` host-group and variables): | ||
|
||
ansible-playbook -i {{ inventory_dir }}/openstack-private.py os-idr-uod.yml | ||
-e vm_key_name="KEY_NAME" -e vm_prefix=PREFIX | ||
|
||
Or using a custom group called `os-idrstaging` with additional variable overrides: | ||
|
||
ansible-playbook -i {{ inventory_dir }}/openstack-private.py os-idr-uod.yml | ||
-e vm_key_name="KEY_NAME" -e vm_prefix=PREFIX | ||
-e @vars/test-overrides.yml -e idr_environment=os-idrstaging | ||
|
||
|
||
Component playbooks | ||
------------------- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# Runs all public playbooks for setting up the IDR infrastructure | ||
# The remaining playbooks require additional private configuration | ||
# Runs all public playbooks for setting up the IDR infrastructure in any | ||
# environment. This does not run any storage/networking/cloud specific | ||
# tasks, nor does it run playbooks requiring private configuration | ||
- include: idr-local-users.yml | ||
- include: idr-omero.yml | ||
- include: idr-local-files.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
# Initialise openstack volumes from inside VMs if necessary | ||
|
||
- hosts: "{{ idr_environment | default('idr') }}-database-hosts" | ||
roles: | ||
- role: storage-volume-initialise | ||
storage_volume_initialise_device: "{{ database_db_vol_dev | default('/dev/vdb') }}" | ||
storage_volume_initialise_mount: /var/lib/pgsql | ||
|
||
- hosts: "{{ idr_environment | default('idr') }}-omero-hosts" | ||
roles: | ||
- role: storage-volume-initialise | ||
storage_volume_initialise_device: "{{ omero_data_vol_dev | default('/dev/vdb') }}" | ||
storage_volume_initialise_mount: /data | ||
|
||
- hosts: "{{ idr_environment | default('idr') }}-proxy-hosts" | ||
roles: | ||
- role: storage-volume-initialise | ||
storage_volume_initialise_device: "{{ gateway_nginxcache_vol_dev | default('/dev/vdb') }}" | ||
storage_volume_initialise_mount: /var/cache/nginx | ||
|
||
# Use this group for any other IDR VMs that should have a volume mounted on /data | ||
- hosts: "{{ idr_environment | default('idr') }}-data-hosts" | ||
roles: | ||
- role: storage-volume-initialise | ||
storage_volume_initialise_device: "{{ data_vol_dev | default('/dev/vdb') }}" | ||
storage_volume_initialise_mount: /data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 this to work, I have to remove
clouds.yaml
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.
This is the public repo so the instructions are designed to work as far as possible without any private config. I assumed any internal instructions would be elsewhere
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.
Understood, but in general, I think we may still need to re-evaluate openstack-private.py (later)