Skip to content

Commit 84dece8

Browse files
committed
Drop postgresql 8.1/RHEL5 specific code
1 parent f094048 commit 84dece8

File tree

7 files changed

+7
-63
lines changed

7 files changed

+7
-63
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 & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,12 @@
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}
1613
$user = #{user}
1714
$group = #{group}
1815
$password = #{password}
19-
$version = '#{version}'
2016
2117
class { 'postgresql::server': }
2218
@@ -34,19 +30,12 @@ class { 'postgresql::server': }
3430
require => Postgresql::Server::Role[$user],
3531
}
3632
37-
# Lets setup the base rules
38-
$local_auth_option = $version ? {
39-
'8.1' => 'sameuser',
40-
default => undef,
41-
}
42-
4333
# Create a rule for the user
4434
postgresql::server::pg_hba_rule { "allow ${user}":
4535
type => 'local',
4636
database => $db,
4737
user => $user,
4838
auth_method => 'ident',
49-
auth_option => $local_auth_option,
5039
order => 1,
5140
}
5241
@@ -70,7 +59,6 @@ class { 'postgresql::server': }
7059
$user = "#{user}"
7160
$group = "#{group}"
7261
$password = #{password}
73-
$version = '#{version}'
7462
7563
class { 'postgresql::server': }
7664
@@ -88,19 +76,12 @@ class { 'postgresql::server': }
8876
require => Postgresql::Server::Role[$user],
8977
}
9078
91-
# Lets setup the base rules
92-
$local_auth_option = $version ? {
93-
'8.1' => 'sameuser',
94-
default => undef,
95-
}
96-
9779
# Create a rule for the user
9880
postgresql::server::pg_hba_rule { "allow ${user}":
9981
type => 'local',
10082
database => $db,
10183
user => $user,
10284
auth_method => 'ident',
103-
auth_option => $local_auth_option,
10485
order => 1,
10586
}
10687

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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy