2013-08-27 22:43:47 +02:00
|
|
|
# Class for setting cross-class global overrides. See README.md for more
|
|
|
|
# details.
|
|
|
|
class postgresql::globals (
|
|
|
|
$client_package_name = undef,
|
|
|
|
$server_package_name = undef,
|
|
|
|
$contrib_package_name = undef,
|
|
|
|
$devel_package_name = undef,
|
|
|
|
$java_package_name = undef,
|
2014-04-02 23:52:07 +02:00
|
|
|
$perl_package_name = undef,
|
2013-08-27 22:43:47 +02:00
|
|
|
$plperl_package_name = undef,
|
|
|
|
$python_package_name = undef,
|
2014-04-08 16:40:49 +02:00
|
|
|
$postgis_package_name = undef,
|
2013-08-27 22:43:47 +02:00
|
|
|
|
|
|
|
$service_name = undef,
|
|
|
|
$service_provider = undef,
|
|
|
|
$service_status = undef,
|
2013-10-27 02:50:05 +02:00
|
|
|
$default_database = undef,
|
2013-08-27 22:43:47 +02:00
|
|
|
|
|
|
|
$initdb_path = undef,
|
|
|
|
$createdb_path = undef,
|
|
|
|
$psql_path = undef,
|
|
|
|
$pg_hba_conf_path = undef,
|
2014-07-24 22:04:02 +02:00
|
|
|
$pg_ident_conf_path = undef,
|
2013-08-27 22:43:47 +02:00
|
|
|
$postgresql_conf_path = undef,
|
|
|
|
|
|
|
|
$pg_hba_conf_defaults = undef,
|
|
|
|
|
|
|
|
$datadir = undef,
|
|
|
|
$confdir = undef,
|
|
|
|
$bindir = undef,
|
2013-09-25 19:00:24 +02:00
|
|
|
$xlogdir = undef,
|
2013-08-27 22:43:47 +02:00
|
|
|
|
|
|
|
$user = undef,
|
|
|
|
$group = undef,
|
|
|
|
|
|
|
|
$version = undef,
|
2013-10-16 21:46:50 +02:00
|
|
|
$postgis_version = undef,
|
2013-08-27 22:43:47 +02:00
|
|
|
|
|
|
|
$needs_initdb = undef,
|
|
|
|
|
|
|
|
$encoding = undef,
|
|
|
|
$locale = undef,
|
|
|
|
|
2013-10-02 14:43:21 +02:00
|
|
|
$manage_pg_hba_conf = undef,
|
2014-07-24 22:04:02 +02:00
|
|
|
$manage_pg_ident_conf = undef,
|
2013-08-27 22:43:47 +02:00
|
|
|
|
|
|
|
$manage_package_repo = undef
|
|
|
|
) {
|
|
|
|
# We are determining this here, because it is needed by the package repo
|
|
|
|
# class.
|
2013-09-03 20:46:07 +02:00
|
|
|
$default_version = $::osfamily ? {
|
2013-09-18 01:05:14 +02:00
|
|
|
/^(RedHat|Linux)/ => $::operatingsystem ? {
|
|
|
|
'Fedora' => $::operatingsystemrelease ? {
|
2014-10-27 19:23:29 +01:00
|
|
|
/^(21)$/ => '9.3',
|
2013-09-18 01:05:14 +02:00
|
|
|
/^(18|19|20)$/ => '9.2',
|
2013-10-02 23:27:46 +02:00
|
|
|
/^(17)$/ => '9.1',
|
2013-09-18 01:05:14 +02:00
|
|
|
default => undef,
|
|
|
|
},
|
2013-10-02 21:38:20 +02:00
|
|
|
'Amazon' => '9.2',
|
2013-09-18 01:05:14 +02:00
|
|
|
default => $::operatingsystemrelease ? {
|
2014-05-08 22:44:53 +02:00
|
|
|
/^7\./ => '9.2',
|
2013-09-18 01:05:14 +02:00
|
|
|
/^6\./ => '8.4',
|
|
|
|
/^5\./ => '8.1',
|
|
|
|
default => undef,
|
|
|
|
},
|
2013-08-27 22:43:47 +02:00
|
|
|
},
|
|
|
|
'Debian' => $::operatingsystem ? {
|
|
|
|
'Debian' => $::operatingsystemrelease ? {
|
|
|
|
/^6\./ => '8.4',
|
2013-09-03 20:46:07 +02:00
|
|
|
/^(wheezy|7\.)/ => '9.1',
|
2014-11-21 19:56:18 +01:00
|
|
|
/^(jessie|8\.)/ => '9.4',
|
2013-08-27 22:43:47 +02:00
|
|
|
default => undef,
|
|
|
|
},
|
|
|
|
'Ubuntu' => $::operatingsystemrelease ? {
|
2014-11-14 15:45:38 +01:00
|
|
|
/^(14.10)$/ => '9.4',
|
2013-10-27 11:57:16 +01:00
|
|
|
/^(14.04)$/ => '9.3',
|
2013-10-26 11:25:33 +02:00
|
|
|
/^(11.10|12.04|12.10|13.04|13.10)$/ => '9.1',
|
2013-08-27 22:43:47 +02:00
|
|
|
/^(10.04|10.10|11.04)$/ => '8.4',
|
|
|
|
default => undef,
|
|
|
|
},
|
|
|
|
default => undef,
|
|
|
|
},
|
2013-09-21 16:48:03 +02:00
|
|
|
'Archlinux' => $::operatingsystem ? {
|
|
|
|
/Archlinux/ => '9.2',
|
|
|
|
default => '9.2',
|
|
|
|
},
|
2013-12-08 09:15:21 +01:00
|
|
|
'FreeBSD' => '93',
|
2014-09-11 01:29:48 +02:00
|
|
|
'OpenBSD' => '9.3',
|
2014-06-27 15:30:17 +02:00
|
|
|
'Suse' => $::operatingsystem ? {
|
2014-08-28 19:16:57 +02:00
|
|
|
'SLES' => '91',
|
|
|
|
default => undef,
|
2014-06-27 15:30:17 +02:00
|
|
|
},
|
2013-08-27 22:43:47 +02:00
|
|
|
default => undef,
|
|
|
|
}
|
2013-09-03 20:46:07 +02:00
|
|
|
$globals_version = pick($version, $default_version, 'unknown')
|
2013-08-27 22:43:47 +02:00
|
|
|
if($globals_version == 'unknown') {
|
2013-09-21 16:48:03 +02:00
|
|
|
fail('No preferred version defined or automatically detected.')
|
2013-08-27 22:43:47 +02:00
|
|
|
}
|
|
|
|
|
2013-10-16 21:46:50 +02:00
|
|
|
$default_postgis_version = $globals_version ? {
|
2014-05-20 11:32:18 +02:00
|
|
|
'8.1' => '1.3.6',
|
|
|
|
'8.4' => '1.5',
|
|
|
|
'9.0' => '1.5',
|
|
|
|
'9.1' => '1.5',
|
2014-06-27 15:30:17 +02:00
|
|
|
'91' => '1.5',
|
2014-05-20 11:32:18 +02:00
|
|
|
'9.2' => '2.0',
|
|
|
|
'9.3' => '2.1',
|
2014-11-21 19:56:18 +01:00
|
|
|
'9.4' => '2.1',
|
2014-09-01 23:00:39 +02:00
|
|
|
'93' => '2.1',
|
2014-05-20 11:32:18 +02:00
|
|
|
default => undef,
|
2013-10-16 21:46:50 +02:00
|
|
|
}
|
|
|
|
$globals_postgis_version = pick($postgis_version, $default_postgis_version)
|
|
|
|
|
2013-08-27 22:43:47 +02:00
|
|
|
# Setup of the repo only makes sense globally, so we are doing this here.
|
|
|
|
if($manage_package_repo) {
|
2014-09-08 21:06:48 +02:00
|
|
|
class { 'postgresql::repo':
|
|
|
|
version => $globals_version
|
2013-09-19 02:16:20 +02:00
|
|
|
}
|
2013-08-27 22:43:47 +02:00
|
|
|
}
|
|
|
|
}
|