nstalls and configures WAL-E using envdir to store configuration. Sets up a crontab entry to perform base backups.
- You still need to configure Postgres manually/separately to archive WAL files.
- By default uses the user
postgres
, which should be created previously, i.e. run thepostgres
role before this one. - You need a backing object store setup (S3, SWIFT, etc)
This is the list of variables used in this role and their defaults
AWS configuration (required):
-
wal_e_s3_prefix
set the bucket url and prefix where to store the values. More info in WAL-E Documentation -
wal_e_aws_instance_profile: false
Set it totrue
to enable IAM instance profiles. If enabled, wal_e_aws_access_key will be ignored More info in WAL-E DocumentationIMPORTANT: Your postgres configuration
archive_command
must also include this option. -
wal_e_aws_access_key
andwal_e_aws_secret_key
AWS S3 credentials
GCE configuration:
-
wal_e_s3_prefix
the same as AWS. However, do not use dots in the bucket name, use hyphens instead dots. -
wal_e_aws_instance_profile: false
This must stay as false as we will not use IAM instance profile. -
wal_e_aws_access_key
andwal_e_aws_secret_key
Google Storage access key and secret. These can be generated fromInteroperability
tab in Google Storage dashboard. -
wal_e_s3_endpoint
set it to "http+path://storage.googleapis.com". GS has interoperability mode which has identical interface to S3.
Installation options:
wal_e_version: 0.8.0
version of WAL-E to installwal_e_pgdata_dir: '/var/lib/postgresql/9.1/main/'
location of the backup data
Default backup job defined in cron:
-
wal_e_base_backup_disabled: false
settrue
to disable automatic setup of this cron job or not -
wal_e_base_backup_minute: '0'
-
wal_e_base_backup_hour: '0'
-
wal_e_base_backup_day: '*'
-
wal_e_base_backup_month: '*'
-
wal_e_base_backup_weekday: '1'
-
wal_e_base_backup_options: ''
Additional options for this job
Postgres user. WAL-E must be allow to read the WAL files:
wal_e_user: 'postgres'
wal_e_group: 'postgres'
Dependency packages and other options:
wal_e_packages
: list of package dependencieswal_e_pips
: : list of package dependencieswal_e_envdir: '/etc/wal-e'
config directory
Postgres user must be created.
---
- hosts: all
sudo: yes
roles:
wal_e_aws_access_key: 'MY_ACCESS_KEY'
wal_e_aws_secret_key: 'MY_SECRET_KEY'
There is a Vagrantfile
and site.yml
which allow test the playbook with
vagrant. Just execute:
vagrant up # first provision
vagrant provision # to rerun ansible
See LICENSE file.