Skip to content

Deployment Steps

James Mbabazi edited this page Aug 25, 2021 · 36 revisions

Note: Instead of these manual steps, you may want to consider using the endtb-specific Ansible playbooks, which can be found here:

https://github.com/endtb/endtb-playbooks

Install endTB Bahmni 2.3.3 for the first time

Please follow the below steps to install Bahmni from Release 2.3.3 with the base database dump provided for endTB.

  1. Install the bahmni-installer along with its pre-requisite software using the following commands:
sudo git clone https://github.com/endtb/endtb-scripts.git 
cd endtb-scripts
chmod 755 install-packages.sh
sh +x install-packages.sh
sudo yum install http://repo.mybahmni.org/releases/bahmni-installer-0.89-193.noarch.rpm
  1. Copy the latest endtb-config folder and base database dump (from endtb-config folder) to the location /etc/bahmni-installer/deployment-artifacts:
cd /etc/bahmni-installer/deployment-artifacts
sudo wget https://github.com/endtb/endtb-config/archive/2.3.3.zip
sudo unzip 2.3.3.zip
sudo mv endtb-config-2.3.3 endtb_config
sudo cp endtb_config/dbdump/mysql_dump.sql openmrs_backup.sql
  1. Manually patching the Oracle Java playbook due to deprecation of old download links:
sudo wget https://raw.githubusercontent.com/Bahmni/bahmni-playbooks/release-0.89/roles/oracle-java/defaults/main.yml -O /opt/bahmni-installer/bahmni-playbooks/roles/oracle-java/defaults/main.yml
  1. Download inventory file for endTB:
sudo wget https://raw.githubusercontent.com/endtb/endtb-config/2.3.3/playbooks/examples/inventory -O /etc/bahmni-installer/inventory
  1. Change the timezone parameter in /etc/bahmni-installer/setup.yml after the below step:
sudo wget https://raw.githubusercontent.com/endtb/endtb-config/2.3.3/playbooks/examples/setup.yml -O /etc/bahmni-installer/setup.yml

  1. Run the installer:
sudo yum clean all
sudo bahmni -i inventory install
sudo bahmni --implementation_play=/var/www/bahmni_config/playbooks/all.yml -i inventory install-impl

  1. Run the batch program for the first time:
sudo su -s /bin/bash bahmni
/usr/bin/bahmni-batch

Upgrade endTB Bahmni from 2.1.0 to 2.2.0

Please follow the below steps to upgrade Bahmni endTB from Release 2.1.0 to 2.2.0

  1. Download bahmni-installer and run it using the following commands:
sudo yum remove -y bahmni-installer
sudo yum install -y https://dl.bintray.com/bahmni/rpm/rpms/bahmni-installer-0.88-101.noarch.rpm
  1. Take a backup of the current database and implementation_config directory before proceeding forward Note: You can also use your own way of taking backup if you have one in place:
sudo bahmni -i inventory backup
cp -R /var/www/implementation_config ~/implementation_config_backup
  1. Copy the latest endtb-config folder to the location /etc/bahmni-installer/deployment-artifacts:
cd /etc/bahmni-installer/deployment-artifacts
sudo rm -rf /etc/bahmni-installer/deployment-artifacts/endtb_config
sudo wget https://github.com/endtb/endtb-config/archive/2.2.0.zip
sudo unzip 2.2.0.zip
sudo mv endtb-config-2.2.0 endtb_config
  1. Manually patching the Oracle Java playbook due to deprecation of old download links.
sudo wget https://raw.githubusercontent.com/Bahmni/bahmni-playbooks/release-0.89/roles/oracle-java/defaults/main.yml -O /opt/bahmni-installer/bahmni-playbooks/roles/oracle-java/defaults/main.yml
  1. Download inventory file for endTB
sudo wget https://raw.githubusercontent.com/endtb/endtb-config/2.2.0/playbooks/examples/inventory -O /etc/bahmni-installer/inventory
  1. Change the timezone parameter in /etc/bahmni-installer/setup.yml after the below step
sudo wget https://raw.githubusercontent.com/endtb/endtb-config/2.2.0/playbooks/examples/setup.yml -O /etc/bahmni-installer/setup.yml
  1. Run the installer:
sudo yum clean all
sudo bahmni -i inventory install
sudo bahmni --implementation_play=/var/www/bahmni_config/playbooks/all.yml -i inventory install-impl
  1. Run the batch program for the first time:
sudo su -s /bin/bash bahmni
/usr/bin/bahmni-batch

Install endTB Bahmni from 2.2.0 for the first time

Please follow the below steps to install Bahmni from Release 2.2.0 with the base database dump provided for endTB.

  1. Install the bahmni-installer along with its pre-requisite software using the following commands:
sudo yum install -y unzip wget
sudo yum install -y https://dl.bintray.com/bahmni/rpm/rpms/bahmni-installer-0.88-101.noarch.rpm
  1. Copy the latest endtb-config folder and base database dump (from endtb-config folder) to the location /etc/bahmni-installer/deployment-artifacts:
cd /etc/bahmni-installer/deployment-artifacts
sudo wget https://github.com/endtb/endtb-config/archive/2.2.0.zip
sudo unzip 2.2.0.zip
sudo mv endtb-config-2.2.0 endtb_config
sudo cp endtb_config/dbdump/mysql_dump.sql openmrs_backup.sql
  1. Manually patching the Oracle Java playbook due to deprecation of old download links:
sudo wget https://raw.githubusercontent.com/Bahmni/bahmni-playbooks/release-0.89/roles/oracle-java/defaults/main.yml -O /opt/bahmni-installer/bahmni-playbooks/roles/oracle-java/defaults/main.yml
  1. Download inventory file for endTB:
sudo wget https://raw.githubusercontent.com/endtb/endtb-config/2.2.0/playbooks/examples/inventory -O /etc/bahmni-installer/inventory
  1. Change the timezone parameter in /etc/bahmni-installer/setup.yml after the below step:
sudo wget https://raw.githubusercontent.com/endtb/endtb-config/2.2.0/playbooks/examples/setup.yml -O /etc/bahmni-installer/setup.yml

  1. Run the installer:
sudo yum clean all
sudo bahmni -i inventory install
sudo bahmni --implementation_play=/var/www/bahmni_config/playbooks/all.yml -i inventory install-impl

  1. Run the batch program for the first time:
sudo su -s /bin/bash bahmni
/usr/bin/bahmni-batch

Troubleshooting/Errata

Sometimes we are seeing an error similar to the following when attempting to install:

TASK [bahmniapps : Download bahmniapps from remote location as zip file] *******
task path: /var/www/bahmni_config/playbooks/roles/bahmniapps/tasks/main.yml:4
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "Failed to validate the SSL certificate for github-production-release-asset-2e65be.s3.amazonaws.com:443. Make sure your managed systems have a valid CA certificate installed. If the website serving the url uses SNI you need python >= 2.7.9 on your managed machine or you can install the `urllib3`, `pyopenssl`, `ndg-httpsclient`, and `pyasn1` python modules to perform SNI verification in python >= 2.6. You can use validate_certs=False if you do not need to confirm the servers identity but this is unsafe and not recommended. Paths checked for this platform: /etc/ssl/certs, /etc/pki/ca-trust/extracted/pem, /etc/pki/tls/certs, /usr/share/ca-certificates/cacert.org, /etc/ansible"}

This appears to be some sort of certificate issue regarding accessing the folder on github where we have published release artifacts.

However, this issue appears to either be transitory or cleared up by running the same command multiple times. If you do run into this error, try just re-running the last command.

Cutting a new release

When you are ready to cut a new release, the following tickets describing the steps to cut the 2.2.0 and 2.3.0/2.3.1 releases may be instructive:

https://tickets.pih-emr.org/browse/ED-152 https://tickets.pih-emr.org/browse/ED-100

Upgrade endTB Bahmni from 2.0.1 to 2.1.0

Please follow the below steps to upgrade Bahmni endTB from Release 2.0.1 to 2.1.0

  1. Download bahmni-installer and run it using the following commands:
sudo yum remove -y bahmni-installer
sudo yum install -y https://dl.bintray.com/bahmni/rpm/rpms/bahmni-installer-0.88-101.noarch.rpm
  1. Take a backup of the current database and implementation_config directory before proceeding forward Note: You can also use your own way of taking backup if you have one in place:
sudo bahmni -i inventory backup
cp -R /var/www/implementation_config ~/implementation_config_backup
  1. Copy the latest endtb-config folder to the location /etc/bahmni-installer/deployment-artifacts:
cd /etc/bahmni-installer/deployment-artifacts
sudo rm -rf /etc/bahmni-installer/deployment-artifacts/endtb_config
sudo wget https://github.com/endtb/endtb-config/archive/2.1.0.zip
sudo unzip 2.1.0.zip
sudo mv endtb-config-2.1.0 endtb_config
  1. Manually patching the Oracle Java playbook due to deprecation of old download links.
sudo wget https://raw.githubusercontent.com/Bahmni/bahmni-playbooks/release-0.89/roles/oracle-java/defaults/main.yml -O /opt/bahmni-installer/bahmni-playbooks/roles/oracle-java/defaults/main.yml
  1. Download inventory file for endTB
sudo wget https://raw.githubusercontent.com/endtb/endtb-config/2.1.0/playbooks/examples/inventory -O /etc/bahmni-installer/inventory
  1. Change the timezone parameter in /etc/bahmni-installer/setup.yml after the below step
sudo wget https://raw.githubusercontent.com/endtb/endtb-config/2.1.0/playbooks/examples/setup.yml -O /etc/bahmni-installer/setup.yml
  1. Run the installer:
sudo yum clean all
sudo bahmni -i inventory install
sudo bahmni --implementation_play=/var/www/bahmni_config/playbooks/all.yml -i inventory install-impl
  1. Run the batch program for the first time:
sudo su -s /bin/bash bahmni
/usr/bin/bahmni-batch

Install endTB Bahmni from 2.1.0 for the first time

Please follow the below steps to install Bahmni from Release 2.1.0 with the base database dump provided for endTB.

  1. Install the bahmni-installer along with its pre-requisite software using the following commands:
sudo yum install -y unzip wget
sudo yum install -y https://dl.bintray.com/bahmni/rpm/rpms/bahmni-installer-0.88-101.noarch.rpm
  1. Copy the latest endtb-config folder and base database dump (from endtb-config folder) to the location /etc/bahmni-installer/deployment-artifacts:
cd /etc/bahmni-installer/deployment-artifacts
sudo wget https://github.com/endtb/endtb-config/archive/2.1.0.zip
sudo unzip 2.1.0.zip
sudo mv endtb-config-2.1.0 endtb_config
sudo cp endtb_config/dbdump/mysql_dump.sql openmrs_backup.sql
  1. Manually patching the Oracle Java playbook due to deprecation of old download links:
sudo wget https://raw.githubusercontent.com/Bahmni/bahmni-playbooks/release-0.89/roles/oracle-java/defaults/main.yml -O /opt/bahmni-installer/bahmni-playbooks/roles/oracle-java/defaults/main.yml
  1. Download inventory file for endTB:
sudo wget https://raw.githubusercontent.com/endtb/endtb-config/2.1.0/playbooks/examples/inventory -O /etc/bahmni-installer/inventory
  1. Change the timezone parameter in /etc/bahmni-installer/setup.yml after the below step:
sudo wget https://raw.githubusercontent.com/endtb/endtb-config/2.1.0/playbooks/examples/setup.yml -O /etc/bahmni-installer/setup.yml

  1. Run the installer:
sudo yum clean all
sudo bahmni -i inventory install
sudo bahmni --implementation_play=/var/www/bahmni_config/playbooks/all.yml -i inventory install-impl

  1. Run the batch program for the first time:
sudo su -s /bin/bash bahmni
/usr/bin/bahmni-batch