5
6
7
8
9
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
|
# File 'manifests/server/instance/systemd.pp', line 5
define postgresql::server::instance::systemd (
Variant[String[1], Stdlib::Port] $port,
Stdlib::Absolutepath $datadir,
Optional[String[1]] $extra_systemd_config = undef,
String[1] $service_name = $name,
Enum[present, absent] $drop_in_ensure = 'present',
) {
if $port =~ String {
deprecation('postgres_port', 'Passing a string to the port parameter is deprecated. Stdlib::Port will be the enforced datatype in the next major release')
}
# Template uses:
# - $port
# - $datadir
# - $extra_systemd_config
systemd::dropin_file { "${service_name}.conf":
ensure => $drop_in_ensure,
unit => "${service_name}.service",
owner => 'root',
group => 'root',
content => epp('postgresql/systemd-override.conf.epp', {
port => $port,
datadir => $datadir,
extra_systemd_config => $extra_systemd_config,
}
),
notify => Class['postgresql::server::service'],
before => Class['postgresql::server::reload'],
}
}
|