All Projects β†’ AlphaNodes β†’ ansible-backup

AlphaNodes / ansible-backup

Licence: GPL-3.0 license
Ansible daily backup role

Programming Languages

Jinja
831 projects

Projects that are alternatives of or similar to ansible-backup

backup-action
πŸ—„οΈ Github Action to backup MySQL, MongoDB and PostgreSQL databases
Stars: ✭ 27 (+8%)
Mutual labels:  mysql-backup, postgresql-backup
zzmysqldump
mysqldump every DB of your MySQL Server to its own, 7z-compressed file.
Stars: ✭ 47 (+88%)
Mutual labels:  backup, mysql-backup
pgsql-backup
PostgreSQL Backup Script. Ported from AutoMySQLBackup.
Stars: ✭ 24 (-4%)
Mutual labels:  backup, postgresql-backup
Ansible Restic
Deploy restic backup program
Stars: ✭ 29 (+16%)
Mutual labels:  backup, ansible-role
ioBroker.backitup
Backitup enables the cyclical creation of backups of an IoBroker / Homematic installation
Stars: ✭ 43 (+72%)
Mutual labels:  backup, mysql-backup
backup-github-repo
Backup all the issues and pull requests of a Github repo, including the comments, events, and labels, as JSON and as HTML
Stars: ✭ 31 (+24%)
Mutual labels:  files, backup
planb
PlanB - automating remote backups and snapshots with zfs/rsync
Stars: ✭ 24 (-4%)
Mutual labels:  backup
ansible-role-cardano-node
Ansible role for the provisioning of Shelly Cardano binaries from source.
Stars: ✭ 20 (-20%)
Mutual labels:  ansible-role
ansible-cloudflared
Install cloudflared and systemd service for DNS-Over-HTTPS
Stars: ✭ 18 (-28%)
Mutual labels:  ansible-role
sicksync
Don’t accept the available as the preferable. Go the extra mile with extra speed.
Stars: ✭ 67 (+168%)
Mutual labels:  backup
trello-full-backup
Python script to backup everything from Trello: boards, lists, cards and attachments
Stars: ✭ 119 (+376%)
Mutual labels:  backup
Fileloader
A library for managing file downloads on the Android platform
Stars: ✭ 27 (+8%)
Mutual labels:  files
proxmox toolbox
A toolbox to get the firsts configurations of Proxmox VE / BS done in no time
Stars: ✭ 158 (+532%)
Mutual labels:  backup
butdr
Backup to Cloud( Google Drive, Dropbox ... ) use rclone
Stars: ✭ 49 (+96%)
Mutual labels:  backup
open2fa
Two-factor authentication app with import/export for iOS and macOS. All codes encrypted with AES 256. FaceID & TouchID support included. Written with love in SwiftUI ❀️
Stars: ✭ 24 (-4%)
Mutual labels:  backup
vbo365-rest-self-service
Unofficial Self-Service Web Portal for Veeam Backup for Microsoft Office 365
Stars: ✭ 24 (-4%)
Mutual labels:  backup
consul role
Ansible role to install Consul (cluster of) server/agent
Stars: ✭ 14 (-44%)
Mutual labels:  ansible-role
myaas
Fresh Mysql instances for your developers in seconds
Stars: ✭ 26 (+4%)
Mutual labels:  backup
ansible-role-github-users
Ansible Role - GitHub Users
Stars: ✭ 49 (+96%)
Mutual labels:  ansible-role
PrometheusWithGrafana
Setup Prometheus with Grafana dashboard using Ansible
Stars: ✭ 50 (+100%)
Mutual labels:  ansible-role

Ansible Role: Backup

Run daily, weekly and monthly backups for files, MySQL databases and PostgreSQL databases on Debian and Ubuntu servers.

Backup rotation is configurable, e.g. you can use Grandfather-father-son

Ansible Galaxy

Dependencies

none

Installation

Ansible 2+

Using ansible galaxy cli:

ansible-galaxy install alphanodes.backup

Role Variables

Available variables are listed below, along with default values (see defaults/main.yml):

backup_dir: /srv/backups

Directory for backups. Make sure there is enough disk space at this disk partition. Use quotes to make sure there are no converting problem (e.g. with to_nice_yaml)

backup_dir_mode: '0755'

Directory permission for backup_dir

backup_dir_owner: root

Directory owner for backup_dir

backup_dir_group: root

Directory group for backup_dir

backup_max_days: 7

Amount of days for daily backup sets. This means only backup_max_days set (days) are stored. Older sets are deleted automatically. Values has to be => 1.

backup_max_weeks: 1

Amount of weeks for weekly backup sets. This means only backup_max_weeks set (weeks) are stored. Older sets are deleted automatically. Values has to be => 1. The weekly backup is created every first day of the week. At this day only this backup is created (and no daily backup - because this would be duplicate).

backup_max_months: 1

Amount of weeks for weekly backup sets. This means only backup_max_months set (months) are stored. Older sets are deleted automatically. Values has to be => 1. The monthly backup is created every first day of the month. At this day only this backup is created (and no daily or weekly backup - because this would be duplicate).

backup_remote_host: ''

Hostname to sync backups for backup_remote_transfer usage.

backup_remote_port: ''

Port to sync backups for backup_remote_transfer usage.

backup_remote_dir: ''

Remote directory of for backup_remote_host for backup_remote_transfer usage.

backup_remote_excludes:
  - '*.journal'
  - '.nfs*'
  - '*.tar'

These file are excluded of sync to remote host. This is only used if backup_remote_transfer is rsync.

backup_rsync_options: '-avz --delete'

rsync options for backup_remote_transfer with rsync.

backup_remote_transfer: rsync

Type of sync. Possible values are: rsync or lftp

backup_remote_user: ''

User for remote sync. This is only used with backup_remote_transfer is lftp.

backup_remote_password: ''

Password for remote sync. This is only used with backup_remote_transfer is lftp.

backup_with_borg: ''

If backupborg should be run.

backup_db_dump_format: .sql.gz

Uncompressed SQL files (.sql) as well as bzip2 (.bz2), gzip (.gz) and xz. At the moment only used for mysql dumps.

backup_with_mysql: false

Run MySQL (MariaDB) backup dump. All databases are stored in separate files.

backup_with_postgresql: false

Run PostgreSQL backup dump. All databases are stored in separate files.

backup_with_mongodb: false

Run MongoDB backup dump. All databases are stored in a single archive file.

backup_mongodb_options: '--archive --gzip'

Options for mongodb dump.

backup_mysql_db_excludes:
  - performance_schema
  - information_schema
  - sys
backup_mysql_single_transaction: true
# backup_mysqldump_options: '--extended-insert=true --opt --single-transaction'

Custom mysql options (always sql.gz is used). If set native mysql_dump (without ansible) is used. Default this is not set.

backup_postgresqldump_options: "--no-owner -Fc"

PostgreSQL dump options.

backup_create_hashfiles: false

Create hash files of all backup sets.

backup_files_unsafe_writes: false

If backup_files_unsafe_writes is yes and changed files are found while creating tar files, no error are reported. tar runs with the additional options --warning=no-file-removed --warning=no-file-changed --warning=no-file-ignored. This option can be overwritten for each set with unsafe_writes.

backup_sets: []

Backup sets for file backup. name is used as backup file name. src is the directory of file, which should be back uped. unsafe_writes overwrites backup_files_unsafe_writes. excludes is a list, which can be used to exclude files or directories.

backup_one_per_day_limit: true

Create only one backup set per day. Existing backup sets of same day will be removed.

#sync_master: anything

If sync_master is defined, backup will be skipped. You can use it for replication environments.

backup_skip_sync_clients: true

If sync_master is defined, this means it is a sync_client.

backup_pre_commands: []

List of commands, which should be run before backup dump.

backup_post_commands: []

List of commands, which runs after backup dump has been created.

Example Playbook

- hosts: server-name
  vars:
    backup_sets:
      - name: etc
        src: /etc
  roles:
    - alphanodes.backup

Extendet example Playbook

- hosts: server-name
  vars:
    backup_max_days: 14
    backup_max_weeks: 4
    backup_max_months: 6
    backup_with_postgresql: true
    backup_dir_mode: '0770'
    backup_dir_group: postgres
    backup_sets:
      - name: etc
        src: /etc
      - name: jenkins
        src: /var/lib/jenkins
        unsafe_writes: true
        excludes:
          - builds
          - workspace
  roles:
    - alphanodes.backup

License

GPL Version 3

Author Information

This role was created in 2018 by AlphaNodes.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].