Skip to content

Commit 530a01a

Browse files
author
Morgan Haskel
committed
Merge pull request puppetlabs#534 from cyberious/MODULES-1485
MODULES-1485 Reverted to default behavior for Debian systems as pg_config should not be overridden
2 parents 7728397 + 9aebc4f commit 530a01a

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ Override for the `ensure` parameter during package installation. Defaults to `pr
506506
Overrides the default package name for the distribution you are installing to. Defaults to `postgresql-devel` or `postgresql<version>-devel` depending on your distro.
507507

508508
####`link_pg_config`
509-
By default, if the bin directory used by the PostgreSQL package is not `/usr/bin` or `/usr/local/bin`,
509+
By default on all but Debian systems, if the bin directory used by the PostgreSQL package is not `/usr/bin` or `/usr/local/bin`,
510510
this class will symlink `pg_config` from the package's bin dir into `/usr/bin`. Set `link_pg_config` to
511511
false to disable this behavior.
512512

manifests/lib/devel.pp

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
class postgresql::lib::devel(
44
$package_name = $postgresql::params::devel_package_name,
55
$package_ensure = 'present',
6-
$link_pg_config = true
6+
$link_pg_config = $postgresql::params::link_pg_config
77
) inherits postgresql::params {
88

99
validate_string($package_name)
@@ -16,7 +16,7 @@
1616

1717
if $link_pg_config {
1818
if ( $postgresql::params::bindir != '/usr/bin' and $postgresql::params::bindir != '/usr/local/bin') {
19-
file {'/usr/bin/pg_config':
19+
file { '/usr/bin/pg_config':
2020
ensure => link,
2121
target => "${postgresql::params::bindir}/pg_config",
2222
}

manifests/params.pp

+6
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
# Amazon Linux's OS Family is 'Linux', operating system 'Amazon'.
2121
case $::osfamily {
2222
'RedHat', 'Linux': {
23+
$link_pg_config = true
2324
$user = pick($user, 'postgres')
2425
$group = pick($group, 'postgres')
2526
$needs_initdb = pick($needs_initdb, true)
@@ -73,6 +74,7 @@
7374
}
7475

7576
'Archlinux': {
77+
$link_pg_config = true
7678
$needs_initdb = pick($needs_initdb, true)
7779
$user = pick($user, 'postgres')
7880
$group = pick($group, 'postgres')
@@ -101,6 +103,7 @@
101103
}
102104

103105
'Debian': {
106+
$link_pg_config = false
104107
$user = pick($user, 'postgres')
105108
$group = pick($group, 'postgres')
106109

@@ -143,6 +146,7 @@
143146
}
144147

145148
'FreeBSD': {
149+
$link_pg_config = true
146150
$user = pick($user, 'pgsql')
147151
$group = pick($group, 'pgsql')
148152

@@ -166,6 +170,7 @@
166170
}
167171

168172
'Suse': {
173+
$link_pg_config = true
169174
$user = pick($user, 'postgres')
170175
$group = pick($group, 'postgres')
171176

@@ -189,6 +194,7 @@
189194
}
190195

191196
default: {
197+
$link_pg_config = true
192198
$psql_path = pick($psql_path, "${bindir}/psql")
193199

194200
# Since we can't determine defaults on our own, we rely on users setting

spec/unit/classes/lib/devel_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
it { is_expected.to contain_class("postgresql::lib::devel") }
1212

1313
describe 'link pg_config to /usr/bin' do
14-
it { should contain_file('/usr/bin/pg_config') \
14+
it { should_not contain_file('/usr/bin/pg_config') \
1515
.with_ensure('link') \
1616
.with_target('/usr/lib/postgresql/8.4/bin/pg_config')
1717
}

0 commit comments

Comments
 (0)