An Ansible playbook to deploy postgresql in a master - slave replication configuration on Exoscale cloud, including continous wal archiving in Exoscale S3 compatible object store using wal-e wal-e.
The goal of this playbook is to demonstrate how fast & easy it can be to deploy applications with high availability into the cloud using Ansible.
apt-get update && apt-get install -y git python-pip python-dev build-essential
git clone https://github.com/exoscale/ansible-pgsql-demo
cd ansible-pgsql-demo
make
You need to setup your API keys. The Key & secret can be found within your portal under the account section.
cat $HOME/.cloudstack.ini
[cloudstack]
endpoint = https://api.exoscale.ch/compute
key = Your API Key here
secret = Your secret key here
Your SSH RSA public key must be present at the following location: '~/.ssh/id_rsa.pub'
A few variables must be setup prior executing this playbook. These variables are located in the following file:
defaults/main.yml
The following variables needs be edited:
- aws_key: "mykey"
- aws_secret: "mysecret"
- aws_bucket: "s3://mybucket/directory/or/whatever"
The bucket must be created prior running the playbook. s3cmd or any S3 compatible tool may be used for this purpose.
To run the playbook:
ansible-playbook -v role.yml
This playbook has been tested only on Ubuntu 14.04.
It is inspired from [this] (https://github.com/lesovsky/ansible-postgresql-on-el6) playbook.