Skip to content

Ansible scripts for managing RHoMIS 2.0 deployments

Notifications You must be signed in to change notification settings

RHoMIS/rhomis-ansible

Repository files navigation

Ansible Management of RHoMIS Components

This repository contains scripts needed to setup, update, test, and deploy the components developed for the RHoMIS 2.0 platform.

Setup

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.

Domain

  • 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. ...

VPS Setup

  • 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

Installation

Requirements:

  • python >= 3.6
  • boto3 >= 1.15.0
  • botocore >= 1.18.0
  • aws-cli >= 2.4.6

Creating a domain

  1. Find a domain provider, in my case I used NameCheap.
  2. Go to your lightsail console, create a new DNS zone, and add the new domain.
  3. Look for the "Name Servers" in your DNS zone, and add these to your domain provider.

Creating vars.yml file

  • Create the vars.yml by copying the vars_template.yml file and renaming it to vars.
  • 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.

Creating inventory file

  • You will need to manage the hosts that you create and ensure you can connect to them.

Managing the instance

  • 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 with create.
  • To delete an instance, replace TAGNAME with delete.

Deployment

  • After the VPS is created,

Useful Links

  • 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,

About

Ansible scripts for managing RHoMIS 2.0 deployments

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published