https://github.com/petermosmans/ansible-role-backup
An ansible role to backup databases and (web) content from a server, and to transfer the backup files to a local destination
https://github.com/petermosmans/ansible-role-backup
Last synced: 5 months ago
JSON representation
An ansible role to backup databases and (web) content from a server, and to transfer the backup files to a local destination
- Host: GitHub
- URL: https://github.com/petermosmans/ansible-role-backup
- Owner: PeterMosmans
- License: gpl-3.0
- Created: 2016-12-15T02:10:05.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-07-09T03:41:29.000Z (almost 9 years ago)
- Last Synced: 2025-01-23T06:29:06.133Z (over 1 year ago)
- Size: 16.6 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Ansible Role: backup
=========
Build status for this role: [](https://travis-ci.org/PeterMosmans/ansible-role-backup)
This role backs up databases and (web) directories from a server, and transfers the backup files to a local destination.
Requirements
------------
If you want to backup MySQL databases, then the server needs to have the Python library `mysql-python` installed.
Role Variables
--------------
Available variables are listed below, along with their default values. The defaults can be found in ```defaults/main.yml```.
**backup_directories**: A list of name / src pairs of directories that will be backed up. Each item contains the full source directory (src), and the corresponding backup name (name). Example:
```
- backup_directories:
- name: mywebsite
src: /var/www/html
```
**backup_location_local**: The directory name of the *local* destination, where the backup files will be transferred to. Note that a subdirectory will be created, with the value of the `inventory_hostname` variable. Defaults to `/backup`.
**backup_location_remote**: The temporary location of the backup files on the *remote* server. Defaults to `/tmp/backup`
**backup_mysql_databases**: A list of MySQL databases that will be backed up. The corresponding backup file will be named `.sql.gz`.
Dependencies
------------
None.
Example Playbook
----------------
```
- hosts: all
become: yes
become_method: sudo
roles:
- role: PeterMosmans.backup
vars:
- backup_mysql_databases:
- mydatabase
- backup_directories:
- name: mywebsite
src: /var/www/mywebsite
```
License
-------
GPLv3
Author Information
------------------
Created by Peter Mosmans. Feedback always welcome.