Ansible script to get a simple instance of DHIS2 configured on a VM with Nginx (with Letsencrypt), Tomcat, and Postgresql.
sudo apt-get install python
brew install ansible
or install using pip.
ansible-galaxy install geerlingguy.postgresql
ansible-galaxy install idealista.tomcat-role
There's a file called all-playbooks.yml
which basically runs through all the individual playbooks
---
- import_playbook: server.yml
- import_playbook: database.yml
- import_playbook: tomcat.yml
- import_playbook: nginx-from-source.yml
- import_playbook: nginx-playbook.yml
Add your public ssh key to server.yml
so that ansible can run commands over ssh without requiring a password.
## Setup your inventory
Define the hostname and user of the server you're deploying to in the your inventory _dhis2-server-credentials.ini
Review vars/main.yml
make sure you define postgresql and tomcat passwords.
You can either run the individual playbooks in the order defined in all-playbooks.yml
or you can run them all in one go.
ansible-playbook -i _dhis2-server-credentials.ini all-playbooks.yml