I'm not sure if this is the right place to ask, but I would really love to use puppet
to deploy bareos
on my servers.
Bareos is a fork of Bacula and is used for backing up remote systems.
To do that bareos uses a server-instance and different client-instances (on each server I want to backup).
The server instance connects to each client he can find in the configuration file. Additionally Bareos will run backup-jobs when he finds a Job-Ressource in config-file.
The set of configuration-files looks like this:
├── bareos-dir.conf
├── bareos-dir.conf.dist
├── bareos-dir.d
│ ├── webui-consoles.conf
│ └── webui-profiles.conf
├── bareos-fd.conf
├── bareos-sd.conf
├── bareos-sd.conf.dist
├── bareos-sd.d
├── bconsole.conf
├── bconsole.conf.dist
├── clients.d
├── director.d
├── storage.d
│ └── device-device.conf
└── tray-monitor.conf
By default clients are defined in bareos-dir.conf
but it's also possible to include configuration-files from other directories.
A client definition with Job and FileRessource looks like this:
Client {
Name = test-fd
Address = test.example.com # the name has to be resolvable through DNS.
Password = "password which is defined in the file-daemon (client) of server test.example.com"
}
Additionally there has to be a Job-Ressource like this:
Job {
Name="test"
JobDefs="DefaultJob"
Client="test-fd"
Pool = Incremental
FileSet="pleskbackup"
}
and a FileSet-Ressource like this:
FileSet {
Name = "pleskbackup"
Include {
Options {
Signature = MD5 # calculate md5 checksum per file
}
File = /var/www
File = /var/backup
File = /var/qmail
}
# Things that usually have to be excluded
# You have to exclude /var/lib/bareos/storage
# on your bareos server
Exclude {
}
}
Now it would be great if I could manage the backupping-stuff with puppet. To do this I'm using netmanagers/bareos. It would be great if I could just add profile::backup::client
to node XY and it automatically installs bareos-fd (client file-daemon)
and connects it with my bareos-server.
I'm using this profile to install bareos to my clients:
class profile::backup::client {
## Install bareos client ##
class {
'bareos':
manage_client => 'true',
}
}
This profile is used to install bareos to my bareos-server:
class profile::backup::server {
## Install bareos server ##
class {
'bareos':
manage_client => 'true',
manage_storage => 'true',
manage_director => 'true',
manage_console => 'true',
}
bareos::storage::device {
'device':
media_type => 'File',
archive_device => '/var/bareos/backup',
}
}
Okay - now I can deploy bareos-clients to my clients and the server to my server - this already works (it's magic ;-) ).
What I want to do next: I would like to configure the system automatically. So the server should be configured to contact the client (to do so, the server needs to know the FQDN and the given password of the client. The client has to apply server-dir as permitted director.
How can I do that?