Giter Club home page Giter Club logo

ansible-role-backupninja's Introduction

Role Name

This role will install and configure backupninja based on my own needs. It uses a temporal folder to create a full backup of a list of directories and encrypt it using GPG. My recommendation is to use it to backup config files and databases to do a quick disaster recovery plan in small servers and PCs.

This role has been tested against Debian, Ubuntu and Centos in their last versions but it may work in other systems too.

Requirements

To use this role you should have installed:

  • tar, gzip

Role Variables

Variables Description Type
ninja_when Time Scheduler for Backupninja String
ninja_backupname Name of a temporal TAR file String
ninja_backupname_def Name of the definitive TAR file String
ninja_backupdir Path with the location of the temporal TAR file String
ninja_backupdir_def Path with the location of the definitive TAR file String
ninja_compress Method to compress the backups done with Backupninja String
ninja_includes List of folders to be saved by the backup String
ninja_excludes List of folder to be excluded by default String
ninja_mysql_enabled Boolean to enable the backup for MySQL databases Boolean
ninja_mysql_hotcopy To use hotcopy in MySQL or not String
ninja_mysql_sqldump To use sqldump as method to backup MySQL String
ninja_mysql_compress To compress the MySQL dump or not String
ninja_mysql_dbhost The host where the database is stored String
ninja_mysql_backupdir Path with the location of the MySQL backup String
ninja_mysql_databases List of databases to be saved in the backup. "all" means all databases String
ninja_mysql_username The user to backup the MySQL databases String
ninja_mysql_password The password of the user to connect to MySQL server String
ninja_retention_period Number of days the backup should be saved String
ninja_gpg_encryption_enabled Boolean to enable the use of GPG cypher in the final step Boolean
ninja_gpg_user GPG user to encrypt the final backup (username@domain) String

Dependencies

This role has no dependencies

Example Playbook

---
- name: Deploy backupninja to backup a MySQL and some folders in Debian
  hosts: my-own-server
  become: true
  vars:
    - ninja_backupname: "files"
    - ninja_backupname_def: "my-own-server"
    - ninja_backupdir: "/tmp/backups"
    - ninja_backupdir_def: "/var/lib/backups"
    - ninja_includes: "/var/www/nextcloud"
    - ninja_mysql_backupdir: "/tmp/backups"

  roles:
    - role: backupninja
---
- name: Deploy backupninja to backup a MySQL and some folders in CentOS
  hosts: my-own-server
  become: true
  vars:
    - ninja_backupname: "files"
    - ninja_backupname_def: "my-own-server"
    - ninja_backupdir: "/tmp/backups"
    - ninja_backupdir_def: "/var/lib/backups"
    - ninja_includes: "/var/www/nextcloud"
    - ninja_mysql_username: "bckadmin"
    - ninja_mysql_userpassword: "mysuperhardtorememberpassword"
    - ninja_mysql_backupdir: "/tmp/backups"

  roles:
    - role: backupninja
---
- name: Deploy backupninja to do an encrypted backup
  hosts: my-own-server
  become: true
  vars:
    - ninja_backupname: "files"
    - ninja_backupname_def: "my-own-server"
    - ninja_backupdir: "/tmp/backups"
    - ninja_backupdir_def: "/var/lib/backups"
    - ninja_includes: "/var/www/nextcloud"
    - ninja_mysql_username: "bckadmin"
    - ninja_mysql_userpassword: "mysuperhardtorememberpassword"
    - ninja_mysql_backupdir: "/tmp/backups"
    - ninja_gpg_encryption_enabled: true
    - ninja_gpg_user: "[email protected]"

  roles:
    - role: backupninja

License

GPLv3

Author Information

Tangelov - https://tangelov.me

ansible-role-backupninja's People

Contributors

tangel0v avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.