Class f3backup::server
In: /modules/f3backup/manifests/server.pp
Parent:

Resources

Included Classes

f3backup::common

Resources

Cron["f3backup"]
   command => "/usr/local/bin/f3backup /etc/f3backup.ini"
   user => "backup"
   hour => $cron_hour
   minute => $cron_minute
   weekday => $cron_weekday
   environment => ["MAILTO=root"]
   require => [User["backup"], File["/usr/local/bin/f3backup"]]

The cron job to start it all

Exec["Creating key pair for user backup"]
   command => /usr/bin/ssh-keygen -b 2048 -t rsa -f $backup_home/.ssh/id_rsa -N ''
   user => "backup"
   group => "backup"
   require => [User["backup"], File[$backup_home/.ssh]]
   creates => $backup_home/.ssh/id_rsa

Create the backup user‘s ssh key pair Note that the pubkey needs to be set in the client

File["/etc/f3backup-exclude.txt"]
   source => puppet:///modules/$module_name/f3backup-exclude.txt
File["/etc/f3backup.ini"]
   content => template("f3backup/f3backup.ini.erb")

The main configuration and exclude files

File["/usr/local/bin/f3backup"]
   source => puppet:///modules/$module_name/f3backup
   mode => "0755"
   require => Package["python-paramiko"]
File["/var/log/f3backup"]
   ensure => directory
   owner => "backup"
   group => "backup"
   mode => "0700"
   require => User["backup"]
File[$backup_home/.ssh/config]
   source => puppet:///modules/$module_name/ssh-config
   owner => "backup"
   group => "backup"
   mode => "0600"
   require => User["backup"]

Make ssh connections "relaxed" so that things work automatically

File[$backup_home/.ssh]
   ensure => directory
   owner => "backup"
   group => "backup"
   mode => "0700"
   require => User["backup"]

Create directory where the ssh key pair will be stored

File[$backup_home/f3backup]
   ensure => directory
   owner => "backup"
   group => "backup"
   require => User["backup"]
Package["hardlinkpy"]
   ensure => installed
Package["python-paramiko"]
   ensure => installed

The main backup script

User["backup"]
   comment => "Backup"
   shell => "/bin/bash"
   home => $backup_home
   managehome => true

Create user backup, who will connect to the clients

[Validate]