Puppet Class: holland::config

Defined in:
manifests/config.pp

Summary

Manage the overall [Holland Backup Manager](http://hollandbackup.org/) configuration.

Overview

Examples:

include holland::config

Parameters:

  • backup_directory (String) (defaults to: $::holland::backup_directory)
  • logfile (String) (defaults to: $::holland::logfile)
  • log_level (String) (defaults to: $::holland::log_level)
  • path (String) (defaults to: $::holland::path)
  • plugin_dirs (String) (defaults to: $::holland::plugin_dirs)
  • umask (String) (defaults to: $::holland::umask)


8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'manifests/config.pp', line 8

class holland::config (
  String $backup_directory = $::holland::backup_directory,
  String $logfile          = $::holland::logfile,
  String $log_level        = $::holland::log_level,
  String $path             = $::holland::path,
  String $plugin_dirs      = $::holland::plugin_dirs,
  String $umask            = $::holland::umask,
) {

  include holland::config::remove_default

  validate_absolute_path($backup_directory)
  validate_absolute_path($logfile)

  $basic_changes       = [
    "set holland/backup_directory ${backup_directory}",
    "set holland/path ${path}",
    "set holland/umask ${umask}",
    "set logging/filename ${logfile}",
    "set logging/level ${log_level}",]

  # TODO test all plugin_dirs entries are valid file paths
  $plugin_dirs_changes = regsubst($plugin_dirs, '(.*)', 'set holland/plugin_dirs/path[ . = "\1" ] \1')

  # FIXME Work around a bug in Puppet 2.6 that doesn't handle parsing arrays as
  # the only argument to a function.
  $conf_changes        = [ $basic_changes, $plugin_dirs_changes ]
  $augeas_changes      = flatten($conf_changes)

  # The file `holland.aug` is managed by the `holland::install` class
  augeas { '/etc/holland/holland.conf':
    context => '/files/etc/holland/holland.conf/',
    incl    => '/etc/holland/holland.conf',
    lens    => 'Holland.lns',
    changes => $augeas_changes,
    onlyif  => 'match holland size == 1',
    require => Class['holland::install'],
  }

}