Module f3backup
In: /modules/f3backup/manifests/gpg_backup_key.pp
/modules/f3backup/manifests/common.pp
/modules/f3backup/manifests/init.pp
/modules/f3backup/manifests/configure.pp
/modules/f3backup/manifests/server.pp
/modules/f3backup/lib/facter/f3backup.rb

F3 Backup

===

Server Example :

    # The main backup server
    class { 'f3backup::server': }
    # The server can't back itself up, rdiff thinks it's already running
    class { 'f3backup::configure': backup_rdiff => false }

Client Examples :

    # Enable full filesystem backup (from site.pp for all nodes)
    include f3backup
    # Disable full filesystem backup on a node
    class { 'f3backup::configure':
        backup_rdiff => false,
    }
    # Exclude filesystem paths from the backup on a node
    class { 'f3backup::configure':
        rdiff_exclude => [
            # The ** is a recursive glob
            '/var/lib/mysql/**',
        ],
    }

You will need to deploy the ssh public key to the client nodes. Example :

    ssh_authorized_key { 'backup@back.example.com':
        key     => 'AAAA...=='
        type    => 'rsa',
        user    => 'root',
        options => [
            'command="rdiff-backup --server --restrict-read-only /"',
            'from="back.example.com,198.51.100.1"',
            'no-port-forwarding',
            'no-agent-forwarding',
            'no-X11-forwarding',
            'no-pty',
        ],
        ensure  => present,
    }

Testing or forcing a backup run :

# su - backup $ f3backup -r node1.example.com /etc/f3backup.ini

Configurable options:

 * force_backup_server (default=""): Force a specific backup server instead of the default one.
 * rdiffbackup (default=true): if true will run an rdiff-backup for the full filesystem
 * mysqlbackup (default=false): if true will run a mysqldump from all the MySQL databases
 * commandbackup (default=false): if true will run a specific command after all backups have finished
 * excludefiles (default=""): array with the directories to be excluded. Each specified directory will be added to the local exclude file. The format should be the same as in rdiff-backup.
 * rdiff_keep (default=4W): time to keep the rdiff-backups
 * rdiff_extraparameters (default=""): extra parameters to be passed to rdiff-backup
 * mysql_backupdir (default="/root/backup/MySQL"): directory where to store the MySQL backups
 * mysql_daystokeep (default=3): days to keep the MySQL backups
 * mysql_monthstokeep (default=2): months to keep the MySQL backups
 * mysql_compress (default="gzip"): how to compress the MySQL backups. There are different options:
  * gzip: compress with gzip on the fly
  * bzip2: compress with bzip2 on the fly
  * none: do not compress the dump
  * later_gzip: compress with gzip after the dump has finished (useful to make the dump to run faster but it uses a lot more of disk space)
  * later_bzip2: compress with bzip2 after the dump has finished (useful to make the dump to run faster but it uses a lot more of disk space)
 * mysql_encrypt (default="none"): how to encrypt the MySQL backups. There are different options:
  * none: do not encrypt the backup
  * gpg: use gpg on the fly.
  * later_gpg: use gpg after the backup has finished.
 * mysql_lock_tables (default=true): Lock all databases when running the backup. If done, no process will be able to modify any table in the database, so if this happens all the processes will be locked until the backup has finished. Enabling this is the only way to run a consistent backup to be used for replication.
 * mysql_extraparameters (default=""): Extra parameters to be passed to mysqldump
 * mysql_sshuser (default="root"): user to be used to connect to the server
 * mysql_key (default="/backup/.ssh/id_rsa-mysql-backup"): ssh key to be used to connect to the server.
 * command_to_execute (default="/bin/true"): command to execute in the backup server if commandbackup=true

Classes and Modules

Class f3backup::common
Class f3backup::configure
Class f3backup::f3backup
Class f3backup::gpg_backup_key
Class f3backup::server

[Validate]