Installs and configure Wal-E an S3 based WAL-shipping disaster recovery and standby toolkit for PostgreSQL.
ubuntu- wal-e has only been tested on ubuntu
runit- for therunit'schpstcommand.python- forpython,virtualenvandpipinstallation and LWRP.
| Key | Type | Description | Default |
|---|---|---|---|
| ['wal-e']['version'] | String | which version to install | "0.7.1" |
| ['wal-e']['install_path'] | String | full path to the wal-e install directory | "/opt/wal-e/" |
| ['wal-e']['env_d_path'] | String | path to the daemontool's env.d path for Wal-E configurations | "/etc/wal-e.d" |
| ['wal-e']['env_path'] | String | path to the daemontool's env path for Wal-E configurations | "/etc/wal-e.d/env" |
| ['wal-e']['exe_path'] | String | full path to the wal-e executable | "/opt/wal-e/bin/wal-e" |
| ['wal-e']['exe_with_env'] | String | command to use to have the full configuration via environment variable | "chpst -e /etc/wal-e.d/env /opt/wal-e/bin/wal-e" |
| ['wal-e']['s3']['data_bag'] | String | name of the data_bag holding the s3 configuration | "aws_credentials" |
| ['wal-e']['s3']['data_bag_item'] | String | name of the data_bag's item holding the s3 configuration | "wal_e" |
| ['wal-e']['s3']['use_encrypted_data_bag'] | Boolean | if the data_bag is expected to be encrypted or not | false |
| ['wal-e']['s3']['default_host'] | String | a default host used to configure boto. This is required to ensure all commands work correctly when bucket is not created in the default S3 zone. The list of possible host can be found at [AWS S3 Endpoint list](http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region). If no value is set then no boto's config file is created. | nil |
| ['wal-e']['postgres_group'] | String | the group of the postgres user, wal-e should be executable for it | postgres |
To either ship WAL or recover from S3, you will have to configure the S3
credentials and bucket to use. This cookbook expects to find them in a
data_bag (encrypted or not).
By default the S3 configuration is expected to be found in an aws_credentials
data_bag, in a wal_e data_bag item.
Here's the expected content of such a data_bag item:
{
"id": "wal_e",
"secret_access_key": "xxxxxxx",
"access_key_id": "xxxxxxx",
"bucket": "postgresql-backup"
}Optionally you can also specify the GPG key to use to encrypt each WAL segment before they are sent to S3. Please note that we don't install nor configure GPG, we're expecting the key id is already setup correctly on the machine. To backup, only the public key is needed, but for recovery the private key needs to be there. See Wal-E Encryption doc for more details.
{
"id": "wal_e",
"secret_access_key": "xxxxxxx",
"access_key_id": "xxxxxxx",
"bucket": "postgresql-backup",
"gpg_key_id": "0xBB9E4B35"
}Include wal-e or more explictly wal-e::default in your node's run_list:
{
"name":"my_node",
"run_list": [
"recipe[wal-e::default]"
]
}- Fork the repository on Github
- Create a named feature branch (like
add_component_x) - Write you change
- Write tests for your change (if applicable)
- Run the tests, ensuring they all pass
- Submit a Pull Request using Github
Author:: Jonathan Tron (jonathan@openhood.com)
Copyright 2013, Openhood S.E.N.C.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.