Use puppet to deploy bareos/bacula with netmanagers/bareos

asked 2016-01-06 03:44:06 -0600

SPQRInc gravatar image

updated 2016-01-07 07:44:25 -0600

Hello,

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?

edit retag flag offensive close merge delete

Comments

Happy to help, is the issue you're having trouble understanding the doco for this project https://forge.puppetlabs.com/netmanagers/bareos/readme ? Or does it seem to lack the feature you need? Or can you in any case explain in more detail what you need puppet to do. Thanks

Alex Harvey gravatar imageAlex Harvey ( 2016-01-06 20:49:09 -0600 )edit

Hi Alex, thanks for your reply. Well, actually I guess that I do not understand the readme or maybe I misunderstand it. My goal is it to automatically deploy bareos to 1. The Bareos-Instance 2. All servers I want to set up a backup for and add these automatically to the bareos-instance

SPQRInc gravatar imageSPQRInc ( 2016-01-07 03:00:54 -0600 )edit

OK, I don't even know what BareOS is, so you'd need to explain what you actually need to do in a way that someone like me can understand. You can edit your post above to explain more fully.

Alex Harvey gravatar imageAlex Harvey ( 2016-01-07 05:31:40 -0600 )edit

Hi Alex, I edited my first post - I hope it's getting clear what I mean. Thanks a lot for your help :-)

SPQRInc gravatar imageSPQRInc ( 2016-01-07 07:45:02 -0600 )edit

I've had a look through the module code, and seems like it doesn't export resources, so I THINK it doesn't do what you want it to do. However, to be sure - can you talk me through the process of registering clients with the server?

Alex Harvey gravatar imageAlex Harvey ( 2016-01-07 08:12:45 -0600 )edit