Unmodified Postgres with some opinionated defaults and plugins.
Packer & Ansible templates that sets up a PostgreSQL server with pre-installed and enabled goodies in either of the following providers:
- AWS (AMIs)
- Digital Ocean (Snapshots)
- Ubuntu 18.04 Bionic (LTS)
✅ Postgres 12
✅ wal_level
= logical
✅ pgcrypto
enabled
✅ pg_stat_statements
enabled
✅ postgis
enabled
✅ pgTAP
enabled
🗹 Packer
🗹 Ansible
$ ansible-galaxy install ANXS.postgresql -r tasks/install_roles.yml --force
DO_TOKEN
,SNAPSHOT_NAME
andREGION
all need to be defined. A list of valid Digital Ocean regions can be found here.
$ export DO_TOKEN=your_digital_ocean_token
$ export SNAPSHOT_NAME=your_snapshot_name
$ export REGION=your_chosen_region
- Create the Digital Ocean snapshot
$ packer build \
-var "do_token=$DO_TOKEN" \
-var "name=$SNAPSHOT_NAME" \
-var "region=$REGION" \
digitalOcean.json
AWS_ACCESS_KEY
,AWS_SECRET_KEY
,SNAPSHOT_NAME
andREGION
all need to be defined. A list of valid AWS regions can be found here.
$ export AWS_ACCESS_KEY=your_aws_access_key
$ export AWS_SECRET_KEY=your_aws_secret_key
$ export SNAPSHOT_NAME=your_snapshot_name
$ export REGION=your_chosen_region
- Create the AWS AMI
$ packer build \
-var "aws_access_key=$AWS_ACCESS_KEY" \
-var "aws_secret_key=$AWS_SECRET_KEY" \
-var "name=$SNAPSHOT_NAME" \
-var "region=$REGION" \
amazon.json
Once this is complete, you now have a snapshot or AMI available to use for any of your droplets or EC2 instances respectively.
- The PostgreSQL server can be further customised. Available provisioning variables that can be manipulated are found in
ansible/vars.yml
- There are also additional provisioning variables from the role anxs.postgres. The exhaustive list can be found here.
- To be in line with the standards of images found in the Digital Ocean Marketplace, scripts found in
scripts
are also ran to clean up the snapshot and make it compatible with the Marketplace. They are taken from here. More information on what these scripts achieve can be found here.
🗹 tbc