Deploy bacula with puppet and foreman

99 views
Skip to first unread message

Timotheus Titus

unread,
Feb 2, 2016, 11:11:10 AM2/2/16
to Puppet Users
 Hello,

I'm using https://github.com/netmanagers/puppet-bacula to deploy bacula to a backup-system and different clients.

The installation of the bacula-director ("main-server") and the bacula-storage ("hdd-handler") is running fine, but if I add a node as server and one as client I do not get an export for my config.

For example:

On the director-node there are different directories and files like

    ├── bacula-dir.conf
    ├── bacula-fd.conf
    ├── bacula-sd.conf
    ├── bconsole.conf
    ├── clients.d
    ├── director.d
    └── storage.d

Now for each client there should be a file called "clientxy.conf" in "clients.d". The files "bacula-sd.conf",  "bconsole.conf" and "bacula-fd.conf" are generated fine - but the client is not generated.

I found a template for the clients in the module - it is located in "templates/director/client.conf.erb" but I do not find an attribute where I could insert this template. 


This is the YAML of my bacula-director-server:

      bacula:
        client_template: bacula/bacula-fd.conf (the title is not correct - it is the configuration file on the client itself, not the client-template for the director)
        console_template: bacula/bconsole.conf.erb
        default_messages: Daemon
        director_template: bacula/bacula-dir.conf.erb
        manage_client: 'false'
        manage_console: 'true'
        manage_director: 'true'
        manage_storage: 'true'
        source_dir_purge: 'true'
        storage_template: bacula/bacula-sd.conf.erb

This is the YAML of my bacula-client-server:


      bacula:
        client_template: bacula/bacula-fd.conf
        console_template: bacula/bconsole.conf.erb
        default_messages: Daemon
        director_template: bacula/bacula-dir.conf.erb
        manage_client: 'true'
        manage_console: 'false'
        manage_director: 'false'
        manage_storage: 'false'
        source_dir_purge: 'false'
        storage_template: bacula/bacula-sd.conf.erb

Any ideas how to solve this and add a node automatically to bacula-dir?

Timotheus Titus

unread,
Feb 2, 2016, 1:31:35 PM2/2/16
to Puppet Users
As far as I see I have to call bacula::director::client somehow as it defines the client-config.

But the question is: How can I do that?

Greg Sutcliffe

unread,
Feb 8, 2016, 4:45:25 AM2/8/16
to puppet-users
On 2 February 2016 at 18:31, Timotheus Titus <spqrinco...@gmail.com> wrote:
As far as I see I have to call bacula::director::client somehow as it defines the client-config.

But the question is: How can I do that?


I'm not familiar with the bacula module, but bacula::director::client seems to be a define rather than a class. ENCs (which is what Foreman is to Puppet) cannot directly declare defines, they can can only declare classes and parameters.

The common pattern for this is to use a wrapper class, taking hash of data that you can use with create_resources. We get this question a lot on the Foreman mailing list, so we have a wiki page detailing some examples. See http://projects.theforeman.org/projects/foreman/wiki/Instantiate_Puppet_resources

Hope that helps!
Greg
--
Greg Sutcliffe
IRC: gwmngilfen

Timotheus Titus

unread,
Feb 9, 2016, 7:46:33 AM2/9/16
to Puppet Users
Thanks a lot - that worked :-)
Reply all
Reply to author
Forward
0 new messages