amritsingh.mongo_s3_backup
Role Name
Ansible role to back up the current MongoDB database, compress it, and upload it to an Amazon S3 bucket.
Role Variables
In this version, you can set the following variables:
script_dir: The folder where scripts are copied and temporary backups are stored.
backup_script_params: These parameters are needed for backup and uploading to S3:
- -u: MongoDB username (optional)
- -p: MongoDB password (optional)
- -k: AWS Access Key
- -s: AWS Secret Key
- -r: Amazon S3 region
- -b: Amazon S3 bucket name
- -x: S3 key prefix
- -a: Number of days of data to keep
Example: "-u ubuntu -p password -k AWS_Access_Key -s AWS_Secret_Key -r Amazon_S3_region -b Amazon_S3_bucket_name -x backup -a 7"
cron_minute: When the job should run (minute) - default: 0
cron_hour: When the job should run (hour) - default: 10
cron_day: When the job should run (day) - default: *
cron_month: When the job should run (month) - default: *
cron_weekday: When the job should run (weekday) - default: *
Dependencies
This package does not require any additional modules beyond those included with Ansible by default.
License
MIT
Author Information
Created by Amrit Singh
Twitter
Ansible role to dumps the current mongo database, tars it, then sends it to an Amazon S3 bucket
ansible-galaxy install amritsingh.mongo_s3_backup