simo2409 / chef-backup

Chef recipe to setup backup gem to store a MySQL/MariaDB db into AWS S3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

backup Cookbook

This cookbook setups backup to backup MySQL/MariaDB database into an S3 bucket.

At the moment this recipe is VERY incomplete and covers only 1 very specific use case: it creates a backup of a single db (from MySQL/MariaDB), compress it and stores it into AWS S3.

Requirements

This recipe requires cron cookbook.

Just drop

cookbook 'cron'

in your Cheffile and run

librarian-chef install

Attributes

{
  "enabled": true,
    "user": "..",
    "destination": {
      "to": "s3",
      "access_key_id": "..",
      "secret_access_key": "..",
      "bucket_name": "..",
      "region": ".."
    },
    "hooks": {
      "slack": {
        "webhook_url": ".."
      }
    }
}

backup::default

Key Type Description Default
['backup']['enabled'] Boolean whether to setup backup or not true
['backup']['user'] String user which performs backup (configuration file will be placed in its home directory) nil
['backup']['destination']['to'] String destination kind (for the moment it must be "s3") "s3"
['backup']['destination']['access_key_id'] String AWS access key id nil
['backup']['destination']['secret_access_key'] String AWS secret access key nil
['backup']['destination']['bucket_name'] String AWS bucket name nil
['backup']['destination']['region'] String AWS region nil
['backup']['hooks']['slack']['webhook_url'] String URL of the slack's webhook where to put backup's notifications nil

Usage

backup::default

Just include backup in your node's run_list:

{
  "name":"my_node",
  "run_list": [
    "recipe[backup]"
  ]
}

and add needed attributes (you can use the structure above)

Contributing

This recipe is highly not complete, until it will be more completed it's not worth to contribute on it.

License and Authors

License: MIT

Authors:

Simone Dall'Angelo

About

Chef recipe to setup backup gem to store a MySQL/MariaDB db into AWS S3


Languages

Language:HTML 66.5%Language:Ruby 33.5%