Skip to content

drop code for Debian 6/7 and Ubuntu 10.04/12.04 #1290

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions manifests/globals.pp
Original file line number Diff line number Diff line change
Expand Up @@ -192,16 +192,12 @@
},
'Debian' => $facts['os']['name'] ? {
'Debian' => $facts['os']['release']['major'] ? {
'6' => '8.4',
'7' => '9.1',
'8' => '9.4',
'9' => '9.6',
'10' => '11',
default => undef,
},
'Ubuntu' => $facts['os']['release']['major'] ? {
/^(10.04|10.10|11.04)$/ => '8.4',
/^(11.10|12.04|12.10|13.04|13.10)$/ => '9.1',
/^(14.04)$/ => '9.3',
/^(14.10|15.04|15.10)$/ => '9.4',
/^(16.04|16.10)$/ => '9.5',
Expand Down
11 changes: 1 addition & 10 deletions manifests/server/config_entry.pp
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,7 @@
# a systemd override for the port or update the sysconfig file, but this
# is managed for us in postgresql::server::config.
if $facts['os']['name'] == 'Debian' or $facts['os']['name'] == 'Ubuntu' {
if $name == 'port' and $facts['os']['release']['major'] in ['6', '10.04'] {
exec { "postgresql_stop_${name}":
command => "service ${postgresql::server::service_name} stop",
onlyif => "service ${postgresql::server::service_name} status",
unless => "grep 'port = ${value}' ${postgresql::server::postgresql_conf_path}",
path => '/usr/sbin:/sbin:/bin:/usr/bin:/usr/local/bin',
before => Postgresql_conf[$name],
}
}
elsif $name == 'data_directory' {
if $name == 'data_directory' {
exec { "postgresql_stop_${name}":
command => "service ${postgresql::server::service_name} stop",
onlyif => "service ${postgresql::server::service_name} status",
Expand Down
24 changes: 0 additions & 24 deletions manifests/server/initdb.pp
Original file line number Diff line number Diff line change
Expand Up @@ -146,30 +146,6 @@
require => File[$require_before_initdb],
cwd => $module_workdir,
}
# The package will take care of this for us the first time, but if we
# ever need to init a new db we need to copy these files explicitly
if $facts['os']['name'] == 'Debian' or $facts['os']['name'] == 'Ubuntu' {
if $facts['os']['release']['major'] in ['6', '7', '10.04', '12.04'] {
file { 'server.crt':
ensure => file,
path => "${datadir}/server.crt",
source => 'file:///etc/ssl/certs/ssl-cert-snakeoil.pem',
owner => $postgresql::server::user,
group => $postgresql::server::group,
mode => '0644',
require => Exec['postgresql_initdb'],
}
file { 'server.key':
ensure => file,
path => "${datadir}/server.key",
source => 'file:///etc/ssl/private/ssl-cert-snakeoil.key',
owner => $postgresql::server::user,
group => $postgresql::server::group,
mode => '0600',
require => Exec['postgresql_initdb'],
}
}
}
} elsif $encoding != undef {
# [workaround]
# by default pg_createcluster encoding derived from locale
Expand Down
10 changes: 5 additions & 5 deletions spec/unit/defines/server/extension_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
os: {
family: 'Debian',
name: 'Debian',
release: { 'full' => '6.0', 'major' => '6' },
release: { 'full' => '10.0', 'major' => '10' },
},
kernel: 'Linux',
id: 'root',
Expand All @@ -148,9 +148,9 @@
}
end

it { is_expected.to contain_file('/var/lib/postgresql/8.4/main') } # FIXME: be more precise
it { is_expected.to contain_concat('/etc/postgresql/8.4/main/pg_hba.conf') } # FIXME: be more precise
it { is_expected.to contain_concat('/etc/postgresql/8.4/main/pg_ident.conf') } # FIXME: be more precise
it { is_expected.to contain_file('/var/lib/postgresql/11/main') } # FIXME: be more precise
it { is_expected.to contain_concat('/etc/postgresql/11/main/pg_hba.conf') } # FIXME: be more precise
it { is_expected.to contain_concat('/etc/postgresql/11/main/pg_ident.conf') } # FIXME: be more precise

context 'with mandatory arguments only' do
it {
Expand All @@ -166,7 +166,7 @@
os: {
family: 'Debian',
name: 'Debian',
release: { 'full' => '6.0', 'major' => '6' },
release: { 'full' => '10.0', 'major' => '10' },
},
kernel: 'Linux',
id: 'root',
Expand Down