0

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?

1

1 Answer 1

1

I have approached this differently. I think it is a waste of time to reinvent the Bareos configuration directives in Puppet code (what with the three tape drives, the robot, spooling etc.), so I have just put the main Bareos configuration (bareos-dir.conf, bareos-sd.conf etc.) in a separate Git repo, which is checked out as /etc/bareos. (Obviously I could use Puppet to copy the files verbatim as well, but commit access for Puppet vs. Bareos configuration had different requirements at the time.)

To configure jobs and clients, I use my own Puppet module, which can be included on all clients and everything will just work ;)

Have a look:

https://github.com/kjetilho/rl-bareos

I have about a thousand clients, it works very nicely for me.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .