Configures VIOS configuration backups on a set of remote machines.
puppet module install arden-vios_backup --version 0.1.0
This module configures a machine to remotely backup, retrieve, and then retain virtual and logical configuration backups from IBM Virtual I/O Servers (VIOS) in a PowerVM environment.
These are config-only backups performed using the viosbr command. Note that there may be cases which necessitate backupios
- this module does not support those forms of backups.
This module changes the following components
/usr/local/bin
which will be used to execute the backupDuring the backup, an entry will be posted to the user
syslog facility with either an info
level for a success message or a err
message for any kind of failure. Each entry will be tagged vios_backup
.
It is assumed that the specified backup user and group are created on the target machine prior to the application of this module.
The public key provided during the configuration of this module must be added to the authorized keys file for each VIOS backed up by this instance.
Transfer a copy of your public key to the target server
VIOS="power1-vio0.example.org"
PUBLIC_KEY="${HOME}/.ssh/id_rsa.pub"
scp "${PUBLIC_KEY}" "padmin@${VIOS}:/tmp/"
Log on to the VIOS and exit the restricted shell.
ssh "padmin@${VIOS}"
oem_setup_env
Append the contents of your key to padmin's authorized_keys file.
KEY_FILE="/tmp/id_rsa.pub"
cat "${KEY_FILE}" >> /home/padmin/.ssh/authorized_keys
Nothing crazy:
/bin/logger
- needed to append messages to the syslog/bin/sh
- the backup script is written targeting the borne shell/bin/ssh
- we need ssh to communicate with the VIOSOnce the setup requirements are met, simply declare the class with all required parameters and you're good to go.
At the moment, all parameters are mandatory. Here's a standard example:
class { 'vios_backup':
user => 'padmin',
group => 'backup',
base_directory => '/srv/backup/vios',
days_retention => 90,
target_vios => [ 'host1-vio0.example.com', 'host1-vio1.example.com' ],
cron_job => {
hour => '1',
minute => '45',
weekday => '0',
}
}
In the example above, two vio servers are backed up each week on Sunday at 1:45. After about two weeks of execution the directory may look similar to the following:
/srv/backup/vios
|-- host1-vio0.example.com
| |-- 2018-12-02_0145.06.tar.gz
| `-- 2018-12-09_0145.02.tar.gz
`-- host1-vio1.example.com
|-- 2018-12-02_0145.26.tar.gz
`-- 2018-12-09_0145.36.tar.gz
Submit a pull request.
Check out the contributor list