Version information
This version is compatible with:
- Puppet Enterprise 2023.8.x, 2023.7.x, 2023.6.x, 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x
- Puppet >= 7.0.0 < 9.0.0
- , , , ,
Start using this module
Add this module to your Puppetfile:
mod 'treydock-backuppc', '1.0.0'
Learn more about managing modules with a PuppetfileDocumentation
backuppc
Table of Contents
- Overview
- Usage - Configuration options and additional functionality
- Limitations - OS compatibility, etc.
Overview
Manage BackupPC 4 server and clients.
This module uses PuppetDB exported resources to allow a BackupPC client to define its own client configuration that is then collected by the BackupPC server.
This module does not support BackupPC 3.x for the server class
Usage
BackupPC Server
It's sufficient to just include the backuppc::server
class.
include backuppc::server
Below are some examples for Hiera to setup BackupPC to be served directly via a FQDN or alias:
backuppc::server::server_host: "%{facts.networking.fqdn}"
backuppc::server::cgi_url: "https://%{lookup('backuppc::server::server_host')}"
Example of creating an Apache VirtualHost for BackupPC
include backuppc::server
apache::vhost { $backuppc::server::server_host:
servername => $backuppc::server::server_host,
port => '443',
ssl => true,
manage_docroot => false,
ssl_cert => "/etc/letsencrypt/live/${backuppc::server::server_host}/cert.pem",
ssl_key => "/etc/letsencrypt/live/${backuppc::server::server_host}/privkey.pem",
ssl_chain => "/etc/letsencrypt/live/${backuppc::server::server_host}/chain.pem",
aliases => [
{
'alias' => $backuppc::server::cgi_image_dir_url,
'path' => $backuppc::server::cgi_image_dir,
},
{
'scriptalias' => '/',
'path' => "${backuppc::server::cgi_dir}/BackupPC_Admin",
},
],
directories => [
{
'provider' => 'location',
'path' => '/',
'auth_type => 'ldap',
'auth_ldap_url' => 'CHANGEME',
...more auth items...
'require' => 'valid-user',
}
]
}
BackupPC Client
For backup clients you must have PuppetDB to handle exported resources. Include the backuppc::client
class:
include backuppc::client
Below is an example of setting baseline backups that could be added to common.yaml
in Hiera
lookup_options:
backuppc::client::rsync_share_name:
merge: unique
backuppc::client::ensure: present
backuppc::client::config_name: "%{facts.networking.hostname}"
backuppc::client::client_name_alias: "%{facts.networking.fqdn}"
backuppc::client::backuppc_hostname: backuppc.example.com
backuppc::client::rsync_share_name:
- /etc
- /root
Reference
http://treydock.github.io/puppet-backuppc/
Limitations
The server class is only supported on EL8 (via EPEL), Debian 11 or Ubuntu 22.04
Reference
Table of Contents
Classes
backuppc::client
: Manage BackupPC clientbackuppc::server
: Manage BackPC server
Data types
Backuppc::BlackoutPeriod
: Type to define BlackoutPeriodsBackuppc::DHCPAddressRange
: Type to define DHCPAddressRanges
Classes
backuppc::client
Manage BackupPC client
Parameters
The following parameters are available in the backuppc::client
class:
backuppc_hostname
ensure
config_name
manage_system_account
system_account
system_account_home_directory
system_account_uid
system_account_gid
system_additional_commands
system_additional_commands_noexec
manage_sudo
manage_rsync
rsync_path
tar_path
client_name_alias
xfer_method
xfer_loglevel
backups_disable
full_period
incr_period
full_keep_cnt
full_keep_cnt_min
full_age_max
incr_keep_cnt
incr_keep_cnt_min
incr_age_max
blackout_bad_ping_limit
ping_max_msec
blackout_good_cnt
backup_files_only
backup_files_exclude
smb_share_name
smb_share_username
smb_share_passwd
smb_client_full_cmd
smb_client_incr_cmd
smb_client_restore_cmd
tar_share_name
tar_client_cmd
tar_full_args
tar_incr_args
tar_client_restore_cmd
rsync_client_path
rsync_ssh_args
rsync_args
rsync_args_extra
rsync_restore_args
rsync_restore_args_extra
rsync_share_name
rsyncd_client_port
rsyncd_user_name
rsyncd_passwd
dump_pre_user_cmd
dump_post_user_cmd
dump_pre_share_cmd
dump_post_share_cmd
restore_pre_user_cmd
restore_post_user_cmd
user_cmd_check_status
email_notify_min_days
email_from_user_name
email_admin_user_name
email_notify_old_backup_days
hosts_file_dhcp
hosts_file_user
hosts_file_more_users
export_sshkey
backuppc_hostname
Data type: Stdlib::Host
The BackupPC hostname This is used to match which BackupPC server is authorized for backups
ensure
Data type: Enum['present','absent']
Whether to add or remove BackupPC client resources
Default value: 'present'
config_name
Data type: String
Name of BackupPC client config
Default value: $facts['networking']['fqdn']
manage_system_account
Data type: Boolean
Manage the user account used to perform backups
Default value: true
system_account
Data type: String
Account used to perform backups
Default value: 'backup'
system_account_home_directory
Data type: Stdlib::Absolutepath
The home directory of backup user
Default value: '/var/backups'
system_account_uid
Data type: Optional[Integer]
Backup user UID
Default value: undef
system_account_gid
Data type: Optional[Integer]
Backup user and group GID
Default value: undef
system_additional_commands
Data type: Array
Authorize commands for backup user via sudo
Default value: []
system_additional_commands_noexec
Data type: Array
Authorize commands for backup user via sudo with NOEXEC
Default value: []
manage_sudo
Data type: Boolean
Include sudo class
Default value: false
manage_rsync
Data type: Boolean
Manage rsync package
Default value: true
rsync_path
Data type: Stdlib::Absolutepath
rsync path
Default value: '/usr/bin/rsync'
tar_path
Data type: Stdlib::Absolutepath
tar path
Default value: '/bin/gtar'
client_name_alias
Data type: Optional[String]
See config.pl ClientNameAlias
Default value: undef
xfer_method
Data type: String
See config.pl XferMethod
Default value: 'rsync'
xfer_loglevel
Data type: Integer
See config.pl XferLogLevel
Default value: 1
backups_disable
Data type: Optional[Boolean]
See config.pl BackupsDisable
Default value: undef
full_period
Data type: Optional[Variant[Integer, Float]]
See config.pl FullPeriod
Default value: undef
incr_period
Data type: Optional[Variant[Integer, Float]]
See config.pl IncrPeriod
Default value: undef
full_keep_cnt
Data type: Optional[Variant[Array[Integer], Integer]]
See config.pl FullKeepCnt
Default value: undef
full_keep_cnt_min
Data type: Optional[Integer]
See config.pl FullKeepCntMin
Default value: undef
full_age_max
Data type: Optional[Integer]
See config.pl FullAgeMax
Default value: undef
incr_keep_cnt
Data type: Optional[Integer]
See config.pl IncrKeepCnt
Default value: undef
incr_keep_cnt_min
Data type: Optional[Integer]
See config.pl IncrKeepCntMin
Default value: undef
incr_age_max
Data type: Optional[Integer]
See config.pl IncrAgeMax
Default value: undef
blackout_bad_ping_limit
Data type: Optional[Integer]
See config.pl BlackoutBadPingLimit
Default value: undef
ping_max_msec
Data type: Optional[Integer]
See config.pl PingMaxMsec
Default value: undef
blackout_good_cnt
Data type: Optional[Integer]
See config.pl BlackoutGoodCnt
Default value: undef
backup_files_only
Data type: Optional[Variant[Hash,Array,String]]
See config.pl BackupFilesOnly
Default value: undef
backup_files_exclude
Data type: Optional[Variant[Hash,Array,String]]
See config.pl BackupFilesExclude
Default value: undef
smb_share_name
Data type: Optional[String]
See config.pl SmbShareName
Default value: undef
smb_share_username
Data type: Optional[String]
See config.pl SmbShareUserName
Default value: undef
smb_share_passwd
Data type: Optional[String]
See config.pl SmbSharePasswd
Default value: undef
smb_client_full_cmd
Data type: Optional[String]
See config.pl SmbClientFullCmd
Default value: undef
smb_client_incr_cmd
Data type: Optional[String]
See config.pl SmbClientIncrCmd
Default value: undef
smb_client_restore_cmd
Data type: Optional[String]
See config.pl SmbClientRestoreCmd
Default value: undef
tar_share_name
Data type: Optional[Variant[Array, String]]
See config.pl TarShareName
Default value: undef
tar_client_cmd
Data type: Optional[String]
See config.pl TarClientCmd
Default value: undef
tar_full_args
Data type: Optional[String]
See config.pl TarFullArgs
Default value: undef
tar_incr_args
Data type: Optional[String]
See config.pl TarIncrArgs
Default value: undef
tar_client_restore_cmd
Data type: Optional[String]
See config.pl TarClientRestoreCmd
Default value: undef
rsync_client_path
Data type: Optional[String]
See config.pl RsyncClientPath
Default value: undef
rsync_ssh_args
Data type: Optional[Array]
See config.pl RsyncSshArgs
Default value: undef
rsync_args
Data type: Optional[Array]
See config.pl RsyncArgs
Default value: undef
rsync_args_extra
Data type: Optional[Array]
See config.pl RsyncArgsExtra
Default value: undef
rsync_restore_args
Data type: Optional[Array]
See config.pl RsyncRestoreArgs
Default value: undef
rsync_restore_args_extra
Data type: Optional[Array]
See config.pl RsyncRestoreArgsExtra
Default value: undef
rsync_share_name
Data type: Optional[Variant[Array, String]]
See config.pl RsyncShareName
Default value: undef
rsyncd_client_port
Data type: Optional[Integer]
See config.pl RsyncdClientPort
Default value: undef
rsyncd_user_name
Data type: Optional[String]
See config.pl RsyncdUserName
Default value: undef
rsyncd_passwd
Data type: Optional[String]
See config.pl RsyncdPasswd
Default value: undef
dump_pre_user_cmd
Data type: Optional[String]
See config.pl DumpPreUserCmd
Default value: undef
dump_post_user_cmd
Data type: Optional[String]
See config.pl DumpPostUserCmd
Default value: undef
dump_pre_share_cmd
Data type: Optional[String]
See config.pl DumpPreShareCmd
Default value: undef
dump_post_share_cmd
Data type: Optional[String]
See config.pl DumpPostShareCmd
Default value: undef
restore_pre_user_cmd
Data type: Optional[String]
See config.pl RestorePreUserCmd
Default value: undef
restore_post_user_cmd
Data type: Optional[String]
See config.pl RestorePostUserCmd
Default value: undef
user_cmd_check_status
Data type: Optional[Boolean]
See config.pl UserCmdCheckStatus
Default value: undef
email_notify_min_days
Data type: Optional[Variant[Integer, Float]]
See config.pl EMailNotifyMinDays
Default value: undef
email_from_user_name
Data type: Optional[String]
See config.pl EMailFromUserName
Default value: undef
email_admin_user_name
Data type: Optional[String]
See config.pl EMailAdminUserName
Default value: undef
email_notify_old_backup_days
Data type: Optional[Integer]
See config.pl EMailNotifyOldBackupDays
Default value: undef
hosts_file_dhcp
Data type: Boolean
Whether to use enable DHCP in hosts file
Default value: false
hosts_file_user
Data type: String
Hosts file user
Default value: 'backuppc'
hosts_file_more_users
Data type: Array
Hosts file more users
Default value: []
export_sshkey
Data type: Boolean
Set whether to export the SSH key for the backup client to BackupPC server
Default value: true
backuppc::server
Manage BackPC server
Parameters
The following parameters are available in the backuppc::server
class:
package_name
manage_repo
service_name
config_dir
replace_config
manage_topdir
topdir
install_dir
log_dir
run_dir
df_path
cat_path
par_path
gzip_path
bzip2_path
rsync_path
tar_path
rsync_bpc_path
ping_path
ping6_path
cgi_dir
cgi_image_dir
cgi_image_dir_url
apache_group
server_host
wakeup_schedule
pool_v3_enabled
max_backups
max_user_backups
max_pending_cmds
max_backup_pc_nightly_jobs
backup_pc_nightly_period
pool_size_nightly_update_period
pool_nightly_digest_check_percent
ref_cnt_fsck
max_old_log_files
df_max_usage_pct
df_max_inode_usage_pct
dhcp_address_ranges
full_period
incr_period
fill_cycle
full_keep_cnt
full_age_max
incr_keep_cnt
incr_age_max
restore_info_keep_cnt
archive_info_keep_cnt
blackout_good_cnt
blackout_periods
blackout_zero_files_is_fatal
rsync_cmd_default_user
rsync_client_path
rsync_args
rsync_args_extra
rsync_full_args_extra
rsync_incr_args_extra
rsync_restore_args
rsync_restore_args_extra
compress_level
email_notify_min_days
email_from_user_name
email_admin_user_name
email_user_dest_domain
email_notify_old_backup_days
email_headers
cgi_admin_user_group
cgi_admin_users
cgi_url
manage_user
user_uid
user_shell
user_gid
package_name
Data type: String
Package name
Default value: 'BackupPC'
manage_repo
Data type: Boolean
Manage repo Only applies to EL systems to manage EPEL
Default value: true
service_name
Data type: String
Service name
Default value: 'backuppc'
config_dir
Data type: Stdlib::Absolutepath
Config directory
Default value: '/etc/BackupPC'
replace_config
Data type: Boolean
Set if replace BackupPC config.pl
Default value: true
manage_topdir
Data type: Boolean
Manage BackupPC topdir
Default value: true
topdir
Data type: Stdlib::Absolutepath
Path to topdir
Default value: '/var/lib/BackupPC'
install_dir
Data type: Stdlib::Absolutepath
BackupPC install directory
Default value: '/usr/share/BackupPC'
log_dir
Data type: Stdlib::Absolutepath
Log directory
Default value: '/var/log/BackupPC'
run_dir
Data type: Stdlib::Absolutepath
Run dir
Default value: '/var/run/BackupPC'
df_path
Data type: Stdlib::Absolutepath
Path to df
Default value: '/usr/bin/df'
cat_path
Data type: Stdlib::Absolutepath
Path to cat
Default value: '/usr/bin/cat'
par_path
Data type: Stdlib::Absolutepath
Path to par2
Default value: '/usr/bin/par2'
gzip_path
Data type: Stdlib::Absolutepath
Path to gzip
Default value: '/usr/bin/gzip'
bzip2_path
Data type: Stdlib::Absolutepath
Path to bzip2
Default value: '/usr/bin/bzip2'
rsync_path
Data type: Stdlib::Absolutepath
Path to rsync
Default value: '/usr/bin/rsync'
tar_path
Data type: Stdlib::Absolutepath
Path to tar
Default value: '/bin/gtar'
rsync_bpc_path
Data type: Stdlib::Absolutepath
Path to rsync_bpc
Default value: '/usr/bin/rsync_bpc'
ping_path
Data type: Stdlib::Absolutepath
Path to ping
Default value: '/usr/sbin/ping'
ping6_path
Data type: Stdlib::Absolutepath
Path to ping6
Default value: '/usr/sbin/ping6'
cgi_dir
Data type: Stdlib::Absolutepath
CGI directory
Default value: '/usr/libexec/BackupPC'
cgi_image_dir
Data type: Stdlib::Absolutepath
CGI image directory
Default value: '/usr/share/BackupPC/html'
cgi_image_dir_url
Data type: Stdlib::Absolutepath
CGI image directory URL
Default value: '/BackupPC/images'
apache_group
Data type: String
Apache group
Default value: 'apache'
server_host
Data type: Stdlib::Fqdn
config.pl ServerHost
Default value: $facts['networking']['fqdn']
wakeup_schedule
Data type: Array[Integer]
config.pl WakeupSchedule
Default value: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23]
pool_v3_enabled
Data type: Boolean
config.pl PoolV3Enabled
Default value: false
max_backups
Data type: Integer
config.pl MaxBackups
Default value: 4
max_user_backups
Data type: Integer
config.pl MaxUserBackups
Default value: 4
max_pending_cmds
Data type: Integer
config.pl MaxPendingCmds
Default value: 15
max_backup_pc_nightly_jobs
Data type: Integer
config.pl MaxBackupPCNightlyJobs
Default value: 2
backup_pc_nightly_period
Data type: Integer
config.pl BackupPCNightlyPeriod
Default value: 1
pool_size_nightly_update_period
Data type: Integer
config.pl PoolSizeNightlyUpdatePeriod
Default value: 16
pool_nightly_digest_check_percent
Data type: Integer
config.pl PoolNightlyDigestCheckPercent
Default value: 1
ref_cnt_fsck
Data type: Integer
config.pl RefCntFsck
Default value: 1
max_old_log_files
Data type: Integer
config.pl MaxOldLogFiles
Default value: 14
df_max_usage_pct
Data type: Integer
config.pl DfMaxUsagePct
Default value: 95
df_max_inode_usage_pct
Data type: Integer
config.pl DfMaxInodeUsagePct
Default value: 95
dhcp_address_ranges
Data type: Array[Backuppc::DHCPAddressRange]
config.pl DHCPAddressRanges
Default value: []
full_period
Data type: Variant[Integer, Float]
config.pl FullPeriod
Default value: 6.97
incr_period
Data type: Variant[Integer, Float]
config.pl IncrPeriod
Default value: 0.97
fill_cycle
Data type: Integer
config.pl FillCycle
Default value: 0
full_keep_cnt
Data type: Variant[Array[Integer], Integer]
config.pl FullKeepCnt
Default value: [1]
full_age_max
Data type: Integer
config.pl FullAgeMax
Default value: 180
incr_keep_cnt
Data type: Integer
config.pl IncrKeepCnt
Default value: 6
incr_age_max
Data type: Integer
config.pl IncrAgeMax
Default value: 30
restore_info_keep_cnt
Data type: Integer
config.pl RestoreInfoKeepCnt
Default value: 10
archive_info_keep_cnt
Data type: Integer
config.pl ArchiveInfoKeepCnt
Default value: 10
blackout_good_cnt
Data type: Integer
config.pl BlackoutGoodCnt
Default value: 7
blackout_periods
Data type: Array[Backuppc::BlackoutPeriod]
config.pl BlackoutPeriods
Default value:
[
{
hour_begin => 7.0,
hour_end => 19.5,
week_days => [1, 2, 3, 4, 5],
}
]
blackout_zero_files_is_fatal
Data type: Boolean
config.pl BackupZeroFilesIsFatal
Default value: true
rsync_cmd_default_user
Data type: String
Default user for rsync backups
Default value: 'root'
rsync_client_path
Data type: String
config.pl RsyncClientPath
Default value: '/usr/bin/rsync'
rsync_args
Data type: Array
config.pl RsyncArgs
Default value: []
rsync_args_extra
Data type: Array
config.pl RsyncArgsExtra
Default value: []
rsync_full_args_extra
Data type: Array
config.pl RsyncFullArgsExtra
Default value: ['--checksum']
rsync_incr_args_extra
Data type: Array
config.pl RsyncIncrArgsExtra
Default value: []
rsync_restore_args
Data type: Array
config.pl RsyncRestoreArgs
Default value: []
rsync_restore_args_extra
Data type: Array
config.pl RsyncRestoreArgsExtra
Default value: []
compress_level
Data type: Integer[1,9]
config.pl CompressLevel
Default value: 3
email_notify_min_days
Data type: Variant[Integer, Float]
config.pl EMailNotifyMinDays
Default value: 2.5
email_from_user_name
Data type: String
config.pl EMailFromUserName
Default value: 'backuppc'
email_admin_user_name
Data type: String
config.pl EMailAdminUserName
Default value: 'backuppc'
email_user_dest_domain
Data type: Optional[String]
config.pl EMailUserDestDomain
Default value: undef
email_notify_old_backup_days
Data type: Variant[Integer, Float]
config.pl EMailNotifyOldBackupDays
Default value: 7.0
email_headers
Data type: Hash
config.pl EMailHeaders
Default value:
{
'MIME-Version' => 1.0,
'Content-Type' => 'text/plain; charset="utf-8"',
}
cgi_admin_user_group
Data type: Variant[Array[String], String]
config.pl CgiAdminUserGroup
Default value: []
cgi_admin_users
Data type: Variant[Array[String], String]
config.pl CgiAdminUsers
Default value: []
cgi_url
Data type: Variant[Stdlib::HTTPUrl, Stdlib::HTTPSUrl]
config.pl CgiURL
Default value: "http://${facts['networking']['fqdn']}/backuppc"
manage_user
Data type: Boolean
Manage BackupPC user and group
Default value: true
user_uid
Data type: Optional[Integer]
BackupPC UID
Default value: undef
user_shell
Data type: Stdlib::Absolutepath
BackupPC user shell
Default value: '/sbin/nologin'
user_gid
Data type: Optional[Integer]
BackupPC user and group GID
Default value: undef
Data types
Backuppc::BlackoutPeriod
Type to define BlackoutPeriods
Alias of
Struct[{
'hour_begin' => Variant[Integer, Float],
'hour_end' => Variant[Integer, Float],
'week_days' => Array[Integer],
}]
Backuppc::DHCPAddressRange
Type to define DHCPAddressRanges
Alias of
Struct[{
'ip_addr_base' => String,
'first' => Integer,
'last' => Integer,
}]
Change log
All notable changes to this project will be documented in this file. The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
v1.0.0 (2024-10-22)
Changed
v0.1.1 (2023-03-08)
Fixed
v0.1.0 (2022-08-31)
Changed
* This Changelog was automatically generated by github_changelog_generator
Dependencies
- puppetlabs/stdlib (>= 9.0.0 <10.0.0)
- puppet/epel (>= 3.0.0 <6.0.0)
- saz/sudo (>= 7.0.0 <10.0.0)