Puppet Class: vrts
- Defined in:
- modules/vrts/manifests/init.pp
Overview
SPDX-License-Identifier: Apache-2.0 Class: vrts
This class installs all the prerequisite packages for VRTS
Parameters:
$vrts_database_host,
The MySQL VRTS database host
$vrts_database_name,
The MySQL VRTS database name
$vrts_database_user,
The MySQL VRTS database user
$vrts_database_pw,
The MySQL VRTS database pass
$vrts_daemon,
Whether to run the daemon. NOTE: only 1 daemon MUST run at time
$exim_database_name,
The MySQL VRTS database name (probably the same)
$exim_database_user,
The MySQL VRTS database user (probably not the same)
$exim_database_pass,
The MySQL VRTS database pass (probably not the same)
$trusted_networks,
The trusted by VRTS networks
Actions:
Install VRTS and prerequisites
Requires:
class {'::vrts':
vrts_database_host => 'host1',
vrts_database_name => 'otrs',
vrts_database_user => 'user',
vrts_database_pw => 'pass',
vrts_daemon => true,
exim_database_name => 'otrs',
exim_database_user => 'eximuser',
exim_database_pass => 'eximpass',
trusted_networks => [],
}
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 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 |
# File 'modules/vrts/manifests/init.pp', line 43
class vrts(
String $install_version,
Stdlib::Host $vrts_database_host,
Stdlib::Host $active_host,
Stdlib::Host $passive_host,
String $vrts_database_name,
String $vrts_database_user,
String $vrts_database_pw,
String $vrts_database_port,
Boolean $vrts_daemon,
String $exim_database_name,
String $exim_database_user,
String $exim_database_pass,
Array $trusted_networks,
String $download_url,
String $http_proxy,
String $https_proxy,
String $public_dns,
Array[Stdlib::Fqdn] $mail_smarthosts,
) {
# Implementation Classes
class { '::vrts::web':
domain_name => $public_dns,
}
class { '::vrts::mail':
vrts_mysql_database => $exim_database_name,
vrts_mysql_user => $exim_database_user,
vrts_mysql_password => $exim_database_pass,
trusted_networks => $trusted_networks,
mail_smarthosts => $mail_smarthosts,
}
# 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',
'perl-doc',
# T187984. Added in 6.0.x as prereqs and optionals
'libdatetime-perl',
'libxml-libxml-perl',
'libxml-libxslt-perl',
'libencode-hanextra-perl',
# Added in 6.3.4 as required
'libauthen-sasl-perl',
'libmail-imapclient-perl',
# Added in 6.4.5 as required
'libical-parser-perl',
# Added in 6.5.10 as required
'libdata-uuid-perl',
'default-mysql-client',
]
ensure_packages($packages)
package { 'libdatetime-timezone-perl': ensure => latest }
user { 'otrs':
home => '/var/lib/otrs',
groups => 'www-data',
shell => '/bin/bash',
managehome => true,
system => true,
}
wmflib::dir::mkdir_p('/etc/vrts', {
owner => 'root',
group => 'root',
mode => '0755',
})
# Maintenance Scripts
file {
default:
ensure => file,
owner => 'root',
group => 'root',
mode => '0744';
'/etc/vrts/install-script-vars':
content => template('vrts/install-script-vars.erb');
'/usr/local/bin/install_vrts':
require => File['/etc/vrts/install-script-vars'],
source => 'puppet:///modules/vrts/install_vrts.sh';
'/usr/local/bin/upgrade_vrts':
source => 'puppet:///modules/vrts/upgrade_vrts.sh';
}
exec { 'Fresh Install':
path => '/usr/local/bin',
command => "/usr/local/bin/install_vrts ${install_version}",
unless => '/usr/bin/test -L /opt/otrs',
require => File['/usr/local/bin/install_vrts'],
}
# Configs
file {
default:
ensure => file,
owner => 'otrs',
mode => '0755',
group => 'www-data';
'/opt/otrs/Kernel/Config.pm':
mode => '0440',
content => template('vrts/Config.pm.erb');
'/opt/otrs/bin/otrs.TicketExport2Mbox.pl':
source => 'puppet:///modules/vrts/vrts.TicketExport2Mbox.pl';
'/opt/otrs/scripts/apache2-perl-startup.pl':
source => 'puppet:///modules/vrts/apache2-perl-startup.pl';
}
# WMF Skin Customizations
file {
default:
ensure => file,
owner => 'otrs',
group => 'www-data',
mode => '0664';
'/opt/otrs/var/httpd/htdocs/skins/Agent/default/img/icons/product.ico':
source => 'puppet:///modules/vrts/wmf.ico';
'/opt/otrs/var/httpd/htdocs/skins/Agent/default/img/logo_bg_wmf.png':
source => 'puppet:///modules/vrts/logo_bg_wmf.png';
'/opt/otrs/var/httpd/htdocs/skins/Agent/default/img/loginlogo_wmf.png':
source => 'puppet:///modules/vrts/loginlogo_wmf.png';
}
$daemon_ensure = $vrts_daemon ? {
true => present,
default => absent,
}
systemd::service { 'vrts-daemon':
ensure => $daemon_ensure,
content => systemd_template('vrts-daemon'),
restart => true,
service_params => {
hasstatus => true,
hasrestart => false,
},
}
systemd::timer::job { 'vrts-cache-cleanup':
ensure => absent,
user => 'otrs',
description => 'Cleanup VRTS cache',
command => '/opt/otrs/bin/otrs.Console.pl Maint::Cache::Delete',
interval => {'start' => 'OnCalendar', 'interval' => 'hourly'},
}
rsync::quickdatacopy { 'vrts':
ensure => present,
source_host => $active_host,
dest_host => $passive_host,
auto_sync => false,
module_path => '/opt',
server_uses_stunnel => true,
progress => true,
}
}
|