Fix debian 7 regexp, rename to default_version and some cleanup
Signed-off-by: Ken Barber <ken@bob.sh>
This commit is contained in:
parent
7d84b6ac0e
commit
a0a2a00a49
4 changed files with 39 additions and 33 deletions
|
@ -41,7 +41,7 @@ class postgresql::globals (
|
|||
) {
|
||||
# We are determining this here, because it is needed by the package repo
|
||||
# class.
|
||||
$postgres_default_version = $::osfamily ? {
|
||||
$default_version = $::osfamily ? {
|
||||
/^(RedHat|Linux)/ => $::operatingsystemrelease ? {
|
||||
/^6\./ => '8.4',
|
||||
/^5\./ => '8.1',
|
||||
|
@ -50,7 +50,7 @@ class postgresql::globals (
|
|||
'Debian' => $::operatingsystem ? {
|
||||
'Debian' => $::operatingsystemrelease ? {
|
||||
/^6\./ => '8.4',
|
||||
/^(wheezy|7\.)$/ => '9.1',
|
||||
/^(wheezy|7\.)/ => '9.1',
|
||||
default => undef,
|
||||
},
|
||||
'Ubuntu' => $::operatingsystemrelease ? {
|
||||
|
@ -62,7 +62,7 @@ class postgresql::globals (
|
|||
},
|
||||
default => undef,
|
||||
}
|
||||
$globals_version = pick($version, $postgres_default_version, 'unknown')
|
||||
$globals_version = pick($version, $default_version, 'unknown')
|
||||
if($globals_version == 'unknown') {
|
||||
fail("No preferred version defined or automatically detected.")
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ class postgresql::params inherits postgresql::globals {
|
|||
$needs_initdb = pick($needs_initdb, true)
|
||||
$firewall_supported = pick($firewall_supported, true)
|
||||
|
||||
if $version == $postgres_default_version {
|
||||
if $version == $default_version {
|
||||
$client_package_name = pick($client_package_name, 'postgresql')
|
||||
$server_package_name = pick($server_package_name, 'postgresql-server')
|
||||
$contrib_package_name = pick($contrib_package_name,'postgresql-contrib')
|
||||
|
|
|
@ -3,8 +3,14 @@ class postgresql::server::install {
|
|||
$package_ensure = $postgresql::server::package_ensure
|
||||
$package_name = $postgresql::server::package_name
|
||||
|
||||
$_package_ensure = $package_ensure ? {
|
||||
true => 'present',
|
||||
false => 'purged',
|
||||
default => $package_ensure,
|
||||
}
|
||||
|
||||
package { 'postgresql-server':
|
||||
ensure => $package_ensure,
|
||||
ensure => $_package_ensure,
|
||||
name => $package_name,
|
||||
|
||||
# This is searched for to create relationships with the package repos, be
|
||||
|
|
Loading…
Reference in a new issue