Skip to content

Commit d204704

Browse files
author
Ashley Penney
committed
Merge pull request puppetlabs#488 from apenney/fix-accept
Fix port changing.
2 parents 3686ae2 + 29a597a commit d204704

File tree

5 files changed

+103
-6
lines changed

5 files changed

+103
-6
lines changed

CHANGELOG.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,86 @@
1+
##2014-09-03 - Supported Release 4.0.0
2+
###Summary
3+
4+
This release removes the uninstall ability from the module, removes the firewall
5+
management, overhauls all of the acceptance testing, as well as adds better
6+
support for SuSE and Fedora.
7+
8+
###Backwards Incompatible changes.
9+
10+
- Uninstall code removal.
11+
- Firewall management for Postgres.
12+
- Set manage_pg_ident_conf to true.
13+
14+
####Uninstallation removal
15+
16+
We rely heavily on the ability to uninstall and reinstall postgres throughout
17+
our testing code, testing features like "can I move from the distribution
18+
packages to the upstream packages through the module" and over time we've
19+
learnt that the uninstall code simply doesn't work a lot of the time. It
20+
leaves traces of postgres behind or fails to remove certain packages on Ubuntu,
21+
and generally causes bits to be left on your system that you didn't expect.
22+
23+
When we then reinstall things fail because it's not a true clean slate, and
24+
this causes us enormous problems during test. We've spent weeks and months
25+
working on these tests and they simply don't hold up well across the full range
26+
of PE platforms.
27+
28+
Due to all these problems we've decided to take a stance on uninstalling in
29+
general. We feel that in 2014 it's completely reasonable and normal to have a
30+
good provisioning pipeline combined with your configuration management and the
31+
"correct" way to uninstall a fully installed service like postgresql is to
32+
simply reprovision the server without it in the first place. As a general rule
33+
this is how I personally like to work and I think is a good practice.
34+
35+
####I'm not OK with this!
36+
37+
We understand that there are environments and situations in which it's not easy
38+
to do that. What if you accidently deployed Postgres on 100,000 nodes? In the
39+
future we're going to take a look at building some example 'profiles' to be
40+
found under examples/ within this module that can uninstall postgres on popular
41+
platforms. These can be modified and used in your specific case to uninstall
42+
postgresql. They will be much more brute force and reliant on deleting entire
43+
directories and require you to do more work up front in specifying where things
44+
are installed but we think it'll prove to be a much cleaner mechanism for this
45+
kind of thing rather than trying to weave it into the main module logic itself.
46+
47+
####Features
48+
- Removal of uninstall.
49+
- Removal of firewall management.
50+
- Tests ported to rspec3.
51+
- Acceptance tests rewritten.
52+
- Add a defined type for creating database schemas.
53+
- Add a pg_ident_rule defined type.
54+
- Set manage_pg_ident_conf to true.
55+
- Manage pg_ident.conf by default.
56+
- Improve selinux support for tablespace.
57+
- Remove deprecation warnings.
58+
- Support changing PGDATA on RedHat.
59+
- Add SLES 11 support.
60+
61+
####Bugfixes
62+
- Link pg_config binary into /usr/bin.
63+
- Fix fedora support by using systemd.
64+
- Initdb should create xlogdir if set.
65+
66+
##2014-08-27 - Supported Release 3.4.3
67+
###Summary
68+
69+
This release fixes Ubuntu 10.04 with Facter 2.2.
70+
71+
####Features
72+
####Bugfixes
73+
- Use a regular expression to match the major OS version on Ubuntu.
74+
75+
##2014-07-31 - Supported Release 3.4.2
76+
###Summary
77+
78+
This release fixes recent Fedora versions.
79+
80+
####Features
81+
####Bugfixes
82+
- Fix Fedora.
83+
184
##2014-07-15 - Supported Release 3.4.1
285
###Summary
386

manifests/params.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
$service_name = $::operatingsystem ? {
113113
'Debian' => pick($service_name, 'postgresql'),
114114
'Ubuntu' => $::lsbmajdistrelease ? {
115-
'10' => pick($service_name, "postgresql-${version}"),
115+
/^10/ => pick($service_name, "postgresql-${version}"),
116116
default => pick($service_name, 'postgresql'),
117117
},
118118
default => undef

manifests/server/config.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
concat { $pg_ident_conf_path:
115115
owner => $user,
116116
group => $group,
117-
force => true, # do not crash if there is no pg_ident_rules
117+
force => true, # do not crash if there is no pg_ident_rules
118118
mode => '0640',
119119
warn => true,
120120
notify => Class['postgresql::server::reload'],

manifests/server/config_entry.pp

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,23 @@
3030
}
3131
}
3232

33-
# We have to handle ports in a weird and special way. On Redhat we either
34-
# have to create a systemd override for the port or update the sysconfig
35-
# file.
33+
# We have to handle ports in a weird and special way. On early Debian and
34+
# Ubuntu we have to ensure we stop the service completely. On Redhat we
35+
# either have to create a systemd override for the port or update the
36+
# sysconfig file.
37+
if $::operatingsystem == 'Debian' or $::operatingsystem == 'Ubuntu' {
38+
if $::operatingsystemrelease =~ /^6/ or $::operatingsystemrelease =~ /^10\.04/ {
39+
if $name == 'port' {
40+
exec { 'postgresql_stop':
41+
command => "service ${::postgresql::server::service_name} stop",
42+
onlyif => "service ${::postgresql::server::service_name} status",
43+
unless => "grep 'port = ${value}' ${::postgresql::server::postgresql_conf_path}",
44+
path => '/usr/sbin:/sbin:/bin:/usr/bin:/usr/local/bin',
45+
before => Postgresql_conf[$name],
46+
}
47+
}
48+
}
49+
}
3650
if $::osfamily == 'RedHat' {
3751
if $::operatingsystemrelease =~ /^7/ or $::operatingsystem == 'Fedora' {
3852
if $name == 'port' {

metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "puppetlabs-postgresql",
3-
"version": "3.4.1",
3+
"version": "4.0.0",
44
"author": "Inkling/Puppet Labs",
55
"summary": "PostgreSQL defined resource types",
66
"license": "ASL 2.0",

0 commit comments

Comments
 (0)