Puppet Class: otrs

Defined in:
manifests/init.pp

Overview

Class: otrs

Full description of class otrs here.

Parameters

Variables

Examples

Authors

Thomas Mueller <thomas@chaschperli.ch>

Copyright 2015 Thomas Mueller

Parameters:

  • install_root (Any) (defaults to: '/opt/otrs')
  • manage_upgrade (Any) (defaults to: false)
  • manage_package (Any) (defaults to: true)
  • manage_service (Any) (defaults to: true)
  • package_name (Any) (defaults to: 'otrs')
  • package_ensure (Any) (defaults to: 'installed')
  • database (Any) (defaults to: 'otrs')
  • database_host (Any) (defaults to: '127.0.0.1')
  • database_user (Any) (defaults to: 'otrs')
  • database_pw (Any) (defaults to: 'some-pass')
  • sysconfig_http_running (Any) (defaults to: '1')
  • sysconfig_cron_running (Any) (defaults to: '1')
  • config_pm_template (Any) (defaults to: "${module_name}/Config.pm.erb")
  • sysconfig_template (Any) (defaults to: "${module_name}/sysconfig.erb")


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
48
49
50
51
52
53
54
55
56
57
# File 'manifests/init.pp', line 20

class otrs(
  $install_root           = '/opt/otrs',
  $manage_upgrade         = false,
  $manage_package         = true,
  $manage_service         = true,
  $package_name           = 'otrs',
  $package_ensure         = 'installed',
  $database               = 'otrs',
  $database_host          = '127.0.0.1',
  $database_user          = 'otrs',
  $database_pw            = 'some-pass',
  $sysconfig_http_running = '1',
  $sysconfig_cron_running = '1',
  $config_pm_template     = "${module_name}/Config.pm.erb",
  $sysconfig_template     = "${module_name}/sysconfig.erb",
) {

  if $package_ensure =~ /^[0-9]+/ {
    $target_version = $package_ensure
  } elsif  $::otrs_rpm_version =~ /^[0-9]+/ {
    $target_version = $::otrs_rpm_version
  } else {
    $target_version = undef
  }

  class { '::otrs::install': } ->
  class { '::otrs::config': } ->
  class { '::otrs::service': }

  if ($manage_upgrade) {
    validate_re($package_ensure, '^[0-9\.]+-[0-9]+', '$manage_upgrade=true requires $package_ensure to be a version number') 

    Class['::otrs::config'] ->
    class { '::otrs::upgrade': } ->
    Class['::otrs::service']
  }

}