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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
# File 'manifests/service.pp', line 10
class gitlab::service (
$service_ensure = $gitlab::service_ensure,
$service_enable = $gitlab::service_enable,
$service_name = $gitlab::service_name,
$service_exec = $gitlab::service_exec,
$service_manage = $gitlab::service_manage,
$service_provider_restart = $gitlab::service_provider_restart,
$skip_post_deployment_migrations = $gitlab::skip_post_deployment_migrations,
) {
if $service_manage {
$restart = "${service_exec} restart"
$start = "${service_exec} start"
$stop = "${service_exec} stop"
$status = "${service_exec} status"
service { $service_name:
ensure => $service_ensure,
enable => $service_enable,
restart => $restart,
start => $start,
stop => $stop,
status => $status,
hasstatus => true,
hasrestart => true,
}
}
$reconfigure_attributes = {
command => '/bin/sh -c "unset LD_LIBRARY_PATH; /usr/bin/gitlab-ctl reconfigure"',
refreshonly => true,
timeout => 1800,
logoutput => true,
tries => 5,
subscribe => Class['gitlab::omnibus_config'],
require => Class['gitlab::install'],
}
if $skip_post_deployment_migrations {
$_reconfigure_attributes = $reconfigure_attributes + { environment => ['SKIP_POST_DEPLOYMENT_MIGRATIONS=true'] }
} else {
$_reconfigure_attributes = $reconfigure_attributes
}
if ($service_manage and $service_provider_restart) {
exec { 'gitlab_reconfigure':
notify => Service[$service_name],
* => $_reconfigure_attributes,
}
} else {
exec { 'gitlab_reconfigure':
* => $_reconfigure_attributes,
}
}
}
|