This repository contains scripts needed to setup, update, test, and deploy the components developed for the RHoMIS 2.0 platform.
Installation of ansible was done using this guide. You need to generate ssh-key pairs so that you can deploy to each of the servers.
You need to ensure that you can ssh to each of your hosts from the ansible vps. To do this, generate an ssh key on the ansible machine. Copy the public ssh key. Add it to the authorized key files for each of your deployments. See here for guidance on ssh key: (https://www.digitalocean.com/community/tutorials/how-to-configure-ssh-key-based-authentication-on-a-linux-server)
You need to create files the config_files/authenticator
directory, and the config_files/data_api
directory. In these you must create .env
files which will be used by the RHoMIS authenticator application, and the Data API.
- Pick a domain name for both your staging site, and your production site. Setup the domain name, and add the named servers of your VPS provider. ...
-
Ubuntu 20.04
-
Swap file
-
Open ports
-
Link to domain
-
This can be automated via ansible, however the scripts to do this depend on your cloud service provider. We have tried to keep these installation instructions independent of providers
- python >= 3.6
- boto3 >= 1.15.0
- botocore >= 1.18.0
- aws-cli >= 2.4.6
- Find a domain provider, in my case I used NameCheap.
- Go to your lightsail console, create a new DNS zone, and add the new domain.
- Look for the "Name Servers" in your DNS zone, and add these to your domain provider.
- Create the
vars.yml
by copying thevars_template.yml
file and renaming it tovars
. - Go through each of the variables, and rename the appropriately based on the domain you have set up, the type of instance you would like, the region/zone.
- You will need to manage the hosts that you create and ensure you can connect to them.
- Each of the blocks in the main playbook
manageLightsailInstance.yml
can be run using the command:
ansible-playbook -v manageLightsailInstance.yml --tags TAGNAME
- To create an instance, replace
TAGNAME
withcreate
. - To delete an instance, replace
TAGNAME
withdelete
.
- After the VPS is created,
-
See here for a full sample ansible setup
-
Handling ansible secrets here
-
See here for a tutorial on getting started with Ansible and AWS lightsail.
-
Good explanation of ansible playbook
-
See here for documentation on how to provision an instance.
-
See here for a guide on Ansible inventories
-
See this tutorial for managing ssl certificates with ansible
-
CI tutorial
-
Manage git credentials with git credential manager. And vscode git credential manager. See here, here,