Puppet Class: otrs

Defined in:
modules/otrs/manifests/init.pp

Overview

Class: otrs

This class installs all the prerequisite packages for OTRS

Parameters:

$otrs_database_host,
    The MySQL OTRS database host
$otrs_database_name,
    The MySQL OTRS database name
$otrs_database_user,
    The MySQL OTRS database user
$otrs_database_pw,
    The MySQL OTRS database pass
$exim_database_name,
    The MySQL OTRS database name (probably the same)
$exim_database_user,
    The MySQL OTRS database user (probably not the same)
$exim_database_pass,
    The MySQL OTRS database pass (probably not the same)
$trusted_networks,
    The trusted by OTRS networks

Actions:

Install OTRS and prerequisites

Requires:

class {'::otrs':
    otrs_database_host => 'host1',
    otrs_database_name => 'otrs',
    otrs_database_user => 'user',
    otrs_database_pw =>  'pass
    exim_database_name => 'otrs',
    exim_database_user => 'eximuser',
    exim_database_pass => 'eximpass',
    trusted_networks =>  [],
}

Parameters:

  • otrs_database_host (Any)
  • otrs_database_name (Any)
  • otrs_database_user (Any)
  • otrs_database_pw (Any)
  • exim_database_name (Any)
  • exim_database_user (Any)
  • exim_database_pass (Any)
  • trusted_networks (Any)


39
40
41
42
43
44
45
46
47
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# File 'modules/otrs/manifests/init.pp', line 39

class otrs(
    $otrs_database_host,
    $otrs_database_name,
    $otrs_database_user,
    $otrs_database_pw,
    $exim_database_name,
    $exim_database_user,
    $exim_database_pass,
    $trusted_networks,
) {
    # Implementation classes
    include ::otrs::web
    class { '::otrs::mail':
        otrs_mysql_database => $exim_database_name,
        otrs_mysql_user     => $exim_database_user,
        otrs_mysql_password => $exim_database_pass,
        trusted_networks    => $trusted_networks,
    }

    # Installation
    $packages = [
        'libapache2-mod-perl2',
        'libapache-dbi-perl',
        'libdbd-mysql-perl',
        'libgd-graph-perl',
        'libgd-text-perl',
        'libio-socket-ssl-perl',
        'libjson-xs-perl',
        'libnet-ldap-perl',
        'libpdf-api2-perl',
        'libsoap-lite-perl',
        'libtext-csv-xs-perl',
        'libtimedate-perl',
        'libyaml-libyaml-perl',
        'libtemplate-perl',
        'libarchive-zip-perl',

        # T248814. Added in 5.0.42 as prereqs
        'libmoo-perl',
        'libnamespace-clean-perl',

        'mysql-client',
        'perl-doc',
    ]
    require_package($packages)

    user { 'otrs':
        home       => '/var/lib/otrs',
        groups     => 'www-data',
        shell      => '/bin/bash',
        managehome => true,
        system     => true,
    }

    file { '/opt/otrs/Kernel/Config.pm':
        ensure  => 'file',
        owner   => 'otrs',
        group   => 'www-data',
        mode    => '0440',
        content => template('otrs/Config.pm.erb'),
    }

    file { '/opt/otrs/bin/otrs.TicketExport2Mbox.pl':
        ensure => 'file',
        owner  => 'otrs',
        group  => 'www-data',
        mode   => '0755',
        source => 'puppet:///modules/otrs/otrs.TicketExport2Mbox.pl',
    }

    file { '/opt/otrs/bin/cgi-bin/idle_agent_report':
        ensure => 'file',
        owner  => 'otrs',
        group  => 'www-data',
        mode   => '0755',
        source => 'puppet:///modules/otrs/idle_agent_report',
    }

    # WMF skin customizations
    file { '/opt/otrs/var/httpd/htdocs/skins/Agent/default/img/icons/product.ico':
        ensure => 'file',
        owner  => 'otrs',
        group  => 'www-data',
        mode   => '0664',
        source => 'puppet:///modules/otrs/wmf.ico',
    }
    file { '/opt/otrs/var/httpd/htdocs/skins/Agent/default/img/logo_bg_wmf.png':
        ensure => 'file',
        owner  => 'otrs',
        group  => 'www-data',
        mode   => '0664',
        source => 'puppet:///modules/otrs/logo_bg_wmf.png',
    }
    file { '/opt/otrs/var/httpd/htdocs/skins/Agent/default/img/loginlogo_wmf.png':
        ensure => 'file',
        owner  => 'otrs',
        group  => 'www-data',
        mode   => '0664',
        source => 'puppet:///modules/otrs/loginlogo_wmf.png',
    }

    systemd::service { 'otrs-daemon':
        ensure         => present,
        content        => systemd_template('otrs-daemon'),
        restart        => true,
        service_params => {
            hasstatus  => true,
            hasrestart => false,
        },
    }
}