Skip to content

Commit 621e633

Browse files
committed
Drop postgresql 8.1/RHEL5 specific code
1 parent 0418970 commit 621e633

File tree

7 files changed

+7
-62
lines changed

7 files changed

+7
-62
lines changed

manifests/globals.pp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@
196196
'8' => '10',
197197
'7' => '9.2',
198198
'6' => '8.4',
199-
'5' => '8.1',
200199
default => undef,
201200
},
202201
},
@@ -248,7 +247,6 @@
248247
}
249248

250249
$default_postgis_version = $globals_version ? {
251-
'8.1' => '1.3.6',
252250
'8.4' => '2.0',
253251
'9.0' => '2.1',
254252
'9.1' => '2.1',

manifests/server/database.pp

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,11 @@
5252

5353
# Optionally set the locale switch. Older versions of createdb may not accept
5454
# --locale, so if the parameter is undefined its safer not to pass it.
55-
if ($version != '8.1') {
56-
$locale_option = $locale ? {
57-
undef => '',
58-
default => "LC_COLLATE = '${locale}' LC_CTYPE = '${locale}'",
59-
}
60-
$public_revoke_privilege = 'CONNECT'
61-
} else {
62-
$locale_option = ''
63-
$public_revoke_privilege = 'ALL'
55+
$locale_option = $locale ? {
56+
undef => '',
57+
default => "LC_COLLATE = '${locale}' LC_CTYPE = '${locale}'",
6458
}
59+
$public_revoke_privilege = 'CONNECT'
6560

6661
$template_option = $template ? {
6762
undef => '',
@@ -96,14 +91,9 @@
9691
}
9792

9893
if $comment {
99-
# The shobj_description function was only introduced with 8.2
100-
$comment_information_function = $version ? {
101-
'8.1' => 'obj_description',
102-
default => 'shobj_description',
103-
}
10494
Postgresql_psql["CREATE DATABASE \"${dbname}\""]
10595
-> postgresql_psql { "COMMENT ON DATABASE \"${dbname}\" IS '${comment}'":
106-
unless => "SELECT 1 FROM pg_catalog.pg_database d WHERE datname = '${dbname}' AND pg_catalog.${comment_information_function}(d.oid, 'pg_database') = '${comment}'", # lint:ignore:140chars
96+
unless => "SELECT 1 FROM pg_catalog.pg_database d WHERE datname = '${dbname}' AND pg_catalog.shobj_description(d.oid, 'pg_database') = '${comment}'", # lint:ignore:140chars
10797
db => $dbname,
10898
}
10999
}

manifests/server/instance/config.pp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,24 +89,16 @@
8989
user => 'all',
9090
}
9191

92-
# Lets setup the base rules
93-
$local_auth_option = $version ? {
94-
'8.1' => 'sameuser',
95-
default => undef,
96-
}
97-
9892
postgresql::server::pg_hba_rule {
9993
"local access as postgres user for instance ${name}":
10094
type => 'local',
10195
user => $user,
10296
auth_method => 'ident',
103-
auth_option => $local_auth_option,
10497
order => 1;
10598

10699
"local access to database with same name for instance ${name}":
107100
type => 'local',
108101
auth_method => 'ident',
109-
auth_option => $local_auth_option,
110102
order => 2;
111103

112104
"allow localhost TCP access to postgresql user for instance ${name}":
@@ -174,7 +166,6 @@
174166
}
175167
else {
176168
$package_name = $facts['os']['release']['major'] ? {
177-
'5' => 'policycoreutils',
178169
'6' => 'policycoreutils-python',
179170
'7' => 'policycoreutils-python',
180171
default => 'policycoreutils-python-utils',

manifests/server/pg_hba_rule.pp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@
7272
'8.4' => ['trust', 'reject', 'md5', 'password', 'gss', 'sspi', 'krb5', 'ident', 'ldap', 'cert', 'pam'],
7373
'8.3' => ['trust', 'reject', 'md5', 'crypt', 'password', 'gss', 'sspi', 'krb5', 'ident', 'ldap', 'pam'],
7474
'8.2' => ['trust', 'reject', 'md5', 'crypt', 'password', 'krb5', 'ident', 'ldap', 'pam'],
75-
'8.1' => ['trust', 'reject', 'md5', 'crypt', 'password', 'krb5', 'ident', 'pam'],
7675
default => ['trust', 'reject', 'scram-sha-256', 'md5', 'password', 'gss', 'sspi', 'krb5', 'ident', 'peer', 'ldap', 'radius', 'cert', 'pam', 'crypt', 'bsd'] # lint:ignore:140chars
7776
}
7877

spec/acceptance/db_spec.rb

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,8 @@ class { 'postgresql::server':
3737

3838
result = psql('--command="SELECT 1 FROM pg_roles WHERE rolname=\'test-user\'"')
3939
expect(result.stdout).to match(%r{\(1 row\)})
40-
comment_information_function = if Gem::Version.new(postgresql_version) > Gem::Version.new('8.1')
41-
'shobj_description'
42-
else
43-
'obj_description'
44-
end
45-
result = psql("--dbname postgresql-test-db --command=\"SELECT pg_catalog.#{comment_information_function}(d.oid, 'pg_database') FROM pg_catalog.pg_database d WHERE datname = 'postgresql-test-db' AND pg_catalog.#{comment_information_function}(d.oid, 'pg_database') = 'testcomment'\"") # rubocop:disable Layout/LineLength
40+
41+
result = psql("--dbname postgresql-test-db --command=\"SELECT pg_catalog.obj_description(d.oid, 'pg_database') FROM pg_catalog.pg_database d WHERE datname = 'postgresql-test-db' AND pg_catalog.#{comment_information_function}(d.oid, 'pg_database') = 'testcomment'\"") # rubocop:disable Layout/LineLength
4642
expect(result.stdout).to match(%r{\(1 row\)})
4743
ensure
4844
psql('--command=\'drop database "postgresql-test-db"\'')

spec/acceptance/server/grant_role_spec.rb

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
let(:user) { 'psql_grant_role_tester' }
88
let(:group) { 'test_group' }
99
let(:password) { 'psql_grant_role_pw' }
10-
let(:version) do
11-
'8.1' if os[:family] == 'redhat' && os[:release].start_with?('5')
12-
end
1310
let(:pp_one) do
1411
<<-MANIFEST.unindent
1512
$db = #{db}
@@ -34,19 +31,12 @@ class { 'postgresql::server': }
3431
require => Postgresql::Server::Role[$user],
3532
}
3633
37-
# Lets setup the base rules
38-
$local_auth_option = $version ? {
39-
'8.1' => 'sameuser',
40-
default => undef,
41-
}
42-
4334
# Create a rule for the user
4435
postgresql::server::pg_hba_rule { "allow ${user}":
4536
type => 'local',
4637
database => $db,
4738
user => $user,
4839
auth_method => 'ident',
49-
auth_option => $local_auth_option,
5040
order => 1,
5141
}
5242
@@ -70,7 +60,6 @@ class { 'postgresql::server': }
7060
$user = "#{user}"
7161
$group = "#{group}"
7262
$password = #{password}
73-
$version = '#{version}'
7463
7564
class { 'postgresql::server': }
7665
@@ -88,19 +77,12 @@ class { 'postgresql::server': }
8877
require => Postgresql::Server::Role[$user],
8978
}
9079
91-
# Lets setup the base rules
92-
$local_auth_option = $version ? {
93-
'8.1' => 'sameuser',
94-
default => undef,
95-
}
96-
9780
# Create a rule for the user
9881
postgresql::server::pg_hba_rule { "allow ${user}":
9982
type => 'local',
10083
database => $db,
10184
user => $user,
10285
auth_method => 'ident',
103-
auth_option => $local_auth_option,
10486
order => 1,
10587
}
10688

spec/acceptance/server/schema_spec.rb

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,11 @@
33
require 'spec_helper_acceptance'
44

55
describe 'postgresql::server::schema:' do
6-
let(:version) do
7-
'8.1' if os[:family] == 'redhat' && os[:release].start_with?('5')
8-
end
96
let(:pp) do
107
<<-MANIFEST.unindent
118
$db = 'schema_test'
129
$user = 'psql_schema_tester'
1310
$password = 'psql_schema_pw'
14-
$version = '#{version}'
1511
1612
class { 'postgresql::server': }
1713
@@ -29,19 +25,12 @@ class { 'postgresql::server': }
2925
require => Postgresql::Server::Role[$user],
3026
}
3127
32-
# Lets setup the base rules
33-
$local_auth_option = $version ? {
34-
'8.1' => 'sameuser',
35-
default => undef,
36-
}
37-
3828
# Create a rule for the user
3929
postgresql::server::pg_hba_rule { "allow ${user}":
4030
type => 'local',
4131
database => $db,
4232
user => $user,
4333
auth_method => 'ident',
44-
auth_option => $local_auth_option,
4534
order => 1,
4635
}
4736

0 commit comments

Comments
 (0)