This repo is inspired by this post and it consists in the set up of 3 "VMs with ssh" started by vagrant, and the ansible setup(that runs on docker too) to install patroni.
To run this repo is necessary to install:
- GNU Make
- Docker: https://docs.docker.com/get-docker/
- Vagrant: https://developer.hashicorp.com/vagrant/downloads
- Docker Provider for Vagrant: https://developer.hashicorp.com/vagrant/docs/provisioning/docker
Tested on M1 and intel macbooks.
To create the vms, run:
make create-machines
Once the were created, test the ansible connection:
make ansible-ping
If the connection working, setup patroni in the nodes:
make ansible-setup
connect in any of the nodes, like below:
ssh -F vagrant-ssh.cfg db-node-1
In the node run:
sudo su - postgres -c "patronictl -c /etc/patroni.yaml topology"
To remove the vagrant machines, run:
make clean