Skip to content
This repository has been archived by the owner on Jun 15, 2022. It is now read-only.

More parameters to make bacula::cient working on Solaris #7

Merged
merged 2 commits into from Dec 18, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
30 changes: 30 additions & 0 deletions README.md
Expand Up @@ -115,6 +115,16 @@ The following lists all the class parameters the bacula class accepts as well as
use_console bacula_use_console Whether to configure a console resource on the director
console_password bacula_console_password The password to use for the console resource on the director

Additionally the following (uncommon) parameters can be passed to the bacula::client class:

client_conf - File name of bacula-fd configuration file
client_conf_template - Template for bacula-fd configuration file
client_service - The name of bacula-fd service
package_provider - Package provider (for solaris only)
pid_dir - The bacula-fd pid dir
working_dir - The bacula-fd working dir


CLIENTS
=======

Expand Down Expand Up @@ -271,6 +281,26 @@ stored the custom template.

[Using Puppet Templates](http://docs.puppetlabs.com/guides/templating.html)

SOLARIS SUPPORT
===============

Currently this module only configures the Bacula client on Solaris. Bacula Directors and Storage Daemon are not supported yet.

To use bacula::client with the Solaris CSWbaculaclient package set the following class paramenters:

```puppet
class { 'bacula::client':
director_server => 'bacula.domain.com',
director_password => 'xxxxxxx',
client_package => 'CSWbaculaclient',
package_provider => "pkgutil",
client_conf => "/opt/csw/etc/bacula/bacula-fd.conf",
client_service => "cswbacula",
working_dir => "/opt/csw/var/bacula/working",
pid_dir => "/opt/csw/var/bacula/run"
}
```

TODO
====

Expand Down
31 changes: 25 additions & 6 deletions manifests/client.pp
Expand Up @@ -9,6 +9,18 @@
# The director's password
# $client_package:
# The name of the package to install the bacula-fd service.
# $client_conf:
# File name of bacula-fd configuration file
# $client_conf_template:
# Template for bacula-fd configuration file
# $client_service:
# The name of bacula-fd service
# $package_provider:
# Package provider (for solaris only)
# $pid_dir:
# The bacula-fd pid dir
# $working_dir:
# The bacula-fd working dir
#
# Actions:
# - Enforce the $client_package package be installed
Expand All @@ -23,26 +35,33 @@
# client_package => 'bacula-client',
# }
class bacula::client(
$director_server,
$client_conf = "/etc/bacula/bacula-fd.conf",
$client_conf_template = "bacula/bacula-fd.conf.erb",
$client_package = "bacula-client",
$client_service = "bacula-fd",
$director_password,
$client_package
$director_server,
$package_provider = undef,
$pid_dir = "/var/run/bacula",
$working_dir = "/var/lib/bacula"
) {

$director_name_array = split($director_server, '[.]')
$director_name = $director_name_array[0]

package { $client_package:
ensure => installed,
provider => $package_provider
}

file { '/etc/bacula/bacula-fd.conf':
file { $client_conf:
ensure => file,
content => template('bacula/bacula-fd.conf.erb'),
notify => Service['bacula-fd'],
content => template($client_conf_template),
notify => Service[$client_service],
require => Package[$client_package],
}

service { 'bacula-fd':
service { $client_service:
ensure => running,
enable => true,
require => Package[$client_package],
Expand Down
4 changes: 2 additions & 2 deletions templates/bacula-fd.conf.erb
Expand Up @@ -13,8 +13,8 @@ Director {
# Now configure the actual File Daemon
FileDaemon {
Name = "<%= hostname.split('.').first -%>"
Working Directory = /var/lib/bacula
PID Directory = /var/run/bacula
Working Directory = <%= working_dir %>
PID Directory = <%= pid_dir %>
Maximum Concurrent Jobs = 3
}

Expand Down