Swirrl / ook

Structural search engine
https://search-prototype.gss-data.org.uk/
Eclipse Public License 1.0
6 stars 0 forks source link

Add ansible playbook to install omni package on already-provisioned instance #28

Closed Robsteranium closed 3 years ago

Robsteranium commented 3 years ago

This should take an omni package name - e.g. from circle ci (per pack_image.sh), then install this over the top of the installed version of ook and then restart the service.

Something like this (from deploy/packer/template/install/install-dependencies.sh):

sudo -E java -jar $OMNI_JAR install $OOK_PACKAGE_NAME -c $BOOTSTRAP_DIR/config/config.edn --environment prod --transitive

Packer has already installed and used omni so this shouldn't be too hard to get going.

We can have ansible find the already provisioning ook server itself with a gcp inventory plugin, e.g. gcp.yml:

plugin: gcp_compute
zones:
  - europe-west1-b
projects:
  - swirrl-staging-servers
filters:
  - labels.application=ook
scopes:
  - https://www.googleapis.com/auth/compute
service_account_file: /path/to/service-account.json
auth_kind: serviceaccount

e.g. try ansible "*" -i gcp.yml -m ansible.builtin.ping

Note that the ansible server.yml playbook will need to be updated to apply this label to the instance when it's created.

Robsteranium commented 3 years ago

I've created a #34 for this.

We'll need to change the packed image so that omni and the ook config is installed on the box permanently (e.g. /opt/omni/omni.jar and /etc/opt/ook/omni-config.edn or /etc/opt/omni/ook.edn instead of to /tmp/server).