Puppet Class: icingaweb2::module::fileshipper

Defined in:
manifests/module/fileshipper.pp

Summary

The fileshipper module extends the Director. It offers import sources to deal with CSV, JSON, YAML and XML files.

Overview

@example:

class { 'icingaweb2::module::fileshipper':
  git_revision => 'v1.0.1',
  base_directories => {
    temp => '/var/lib/fileshipper'
  },
  directories      => {
    'test' => {
      'source'     => '/var/lib/fileshipper/source',
      'target'     => '/var/lib/fileshipper/target',
    }
  }
}
Note:

If you want to use ‘git` as `install_method`, the CLI `git` command has to be installed. You can manage it yourself as package resource or declare the package name in icingaweb2 class parameter `extra_packages`.

Note:

To understand this modulei, please read [Fileshipper module documentation](www.icinga.com/docs/director/latest/fileshipper/doc/02-Installation/).

Note:

You’ve to manage source and target directories yourself.

Parameters:

  • ensure (Enum['absent', 'present'])

    Enables or disables module.

  • module_dir (Stdlib::Absolutepath) (defaults to: "${icingaweb2::globals::default_module_path}/fileshipper")

    Target directory of the module.

  • git_repository (Stdlib::HTTPUrl)

    Set a git repository URL.

  • install_method (Enum['git', 'none', 'package'])

    Install methods are ‘git`, `package` and `none` is supported as installation method.

  • package_name (String[1])

    Package name of the module. This setting is only valid in combination with the installation method ‘package`.

  • git_revision (Optional[String[1]]) (defaults to: undef)

    Set either a branch or a tag name, eg. ‘master` or `v1.3.2`.

  • base_directories (Hash)

    Hash of base directories. These directories can later be selected in the import source (Director).

  • directories (Hash)

    Deploy plain Icinga 2 configuration files through the Director to your Icinga 2 master.



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'manifests/module/fileshipper.pp', line 48

class icingaweb2::module::fileshipper (
  Enum['absent', 'present']      $ensure,
  Stdlib::HTTPUrl                $git_repository,
  Enum['git', 'none', 'package'] $install_method,
  String[1]                      $package_name,
  Hash                           $base_directories,
  Hash                           $directories,
  Stdlib::Absolutepath           $module_dir   = "${icingaweb2::globals::default_module_path}/fileshipper",
  Optional[String[1]]            $git_revision = undef,
) {
  require icingaweb2

  $module_conf_dir = "${icingaweb2::globals::conf_dir}/modules/fileshipper"

  if $base_directories {
    $base_directories.each |$identifier, $directory| {
      icingaweb2::module::fileshipper::basedir { $identifier:
        basedir => $directory,
      }
    }
  }

  if $directories {
    $directories.each |$identifier, $settings| {
      icingaweb2::module::fileshipper::directory { $identifier:
        source     => $settings['source'],
        target     => $settings['target'],
        extensions => $settings['extensions'],
      }
    }
  }

  icingaweb2::module { 'fileshipper':
    ensure         => $ensure,
    git_repository => $git_repository,
    git_revision   => $git_revision,
    install_method => $install_method,
    module_dir     => $module_dir,
    package_name   => $package_name,
  }
}