Skip to content

Commit fea6aa8

Browse files
committed
Merge pull request puppetlabs#743 from bmjen/4.7.1_prep
4.7.1 Release Prep
2 parents cfdeee8 + 0d4e932 commit fea6aa8

File tree

20 files changed

+139
-71
lines changed

20 files changed

+139
-71
lines changed

.gitattributes

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1-
*.sh eol=lf
1+
#This file is generated by ModuleSync, do not edit.
22
*.rb eol=lf
3+
*.erb eol=lf
4+
*.pp eol=lf
5+
*.sh eol=lf

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#This file is generated by ModuleSync, do not edit.
12
pkg/
23
Gemfile.lock
34
vendor/

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#This file is generated by ModuleSync, do not edit.
12
---
23
sudo: false
34
language: ruby

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
## Supported Release 4.7.1
2+
### Summary
3+
This release contains some bugfixes and documentation updates.
4+
5+
#### Bugfixes
6+
- (MODULES-3024) Quote database objects when creating databases.
7+
- Properly escape case where password ends with '$'.
8+
- Fixes password change when postgres is configure to non-standard port.
9+
- Unpins concat dependency to be able to use concat 2.x.
10+
- Workaround to fix installing on Amazon Linux.
11+
- Fixes proper defaulting of `$service_provider` parameter.
12+
- Fixes postgres server init script naming on Amazon Linux.
13+
- Fixes service reload parameter on Arch Linux.
14+
- Adds missing onlyif_function to sequence grant code.
15+
- Fixes to the markdown of the README.
16+
117
## Supported Release 4.7.0
218
### Summary
319
A release with a considerable amount of new features, including remote db support and several platform support updates. Various bugfixes including several to address warnings and a sizable README update.

Gemfile

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1+
#This file is generated by ModuleSync, do not edit.
2+
13
source ENV['GEM_SOURCE'] || "https://rubygems.org"
24

3-
def location_for(place, fake_version = nil)
5+
def location_for(place, version = nil)
46
if place =~ /^(git[:@][^#]*)#(.*)/
5-
[fake_version, { :git => $1, :branch => $2, :require => false }].compact
7+
[version, { :git => $1, :branch => $2, :require => false}].compact
68
elsif place =~ /^file:\/\/(.*)/
7-
['>= 0', { :path => File.expand_path($1), :require => false }]
9+
['>= 0', { :path => File.expand_path($1), :require => false}]
810
else
9-
[place, { :require => false }]
11+
[place, version, { :require => false}].compact
1012
end
1113
end
1214

@@ -20,29 +22,18 @@ group :development, :unit_tests do
2022
gem 'simplecov', :require => false
2123
end
2224
group :system_tests do
25+
gem 'beaker-rspec', *location_for(ENV['BEAKER_RSPEC_VERSION'] || '>= 3.4')
26+
gem 'beaker', *location_for(ENV['BEAKER_VERSION'])
27+
gem 'serverspec', :require => false
2328
gem 'beaker-puppet_install_helper', :require => false
24-
if beaker_version = ENV['BEAKER_VERSION']
25-
gem 'beaker', *location_for(beaker_version)
26-
end
27-
if beaker_rspec_version = ENV['BEAKER_RSPEC_VERSION']
28-
gem 'beaker-rspec', *location_for(beaker_rspec_version)
29-
else
30-
gem 'beaker-rspec', :require => false
31-
end
3229
gem 'master_manipulator', :require => false
33-
gem 'serverspec', :require => false
30+
gem 'beaker-hostgenerator', *location_for(ENV['BEAKER_HOSTGENERATOR_VERSION'])
3431
end
3532

36-
if facterversion = ENV['FACTER_GEM_VERSION']
37-
gem 'facter', facterversion, :require => false
38-
else
39-
gem 'facter', :require => false
40-
end
33+
gem 'facter', *location_for(ENV['FACTER_GEM_VERSION'])
34+
gem 'puppet', *location_for(ENV['PUPPET_GEM_VERSION'])
4135

42-
if puppetversion = ENV['PUPPET_GEM_VERSION']
43-
gem 'puppet', puppetversion, :require => false
44-
else
45-
gem 'puppet', :require => false
46-
end
4736

48-
# vim:ft=ruby
37+
if File.exists? "#{__FILE__}.local"
38+
eval(File.read("#{__FILE__}.local"), binding)
39+
end

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@
187187
same "printed page" as the copyright notice for easier
188188
identification within third-party archives.
189189

190-
Copyright 2013 Puppet Labs
190+
Copyright [yyyy] [name of copyright owner]
191191

192192
Licensed under the Apache License, Version 2.0 (the "License");
193193
you may not use this file except in compliance with the License.

NOTICE

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
Puppetlabs postgresql module
1+
postgresql puppet module
22

3-
Copyright 2012 Inkling Systems Inc
4-
Copyright 2012-2013 Puppet Labs Inc
5-
Copyright 2012-2013 Camptocamp SA.
3+
Copyright (C) 2012-2016 Puppet Labs, Inc.
4+
Copyright (C) 2012 Inkling Systems Inc
5+
Copyright (C) 2012-2013 Camptocamp SA.
66

77
This product includes software developed by:
88
The Puppet Labs Inc (http://www.puppetlabs.com/).
@@ -12,3 +12,18 @@ This product includes also software developed by:
1212

1313
This product includes also software developed by:
1414
Inkling Systems Inc (https://www.inkling.com/)
15+
16+
Puppet Labs can be contacted at: [email protected]
17+
18+
19+
Licensed under the Apache License, Version 2.0 (the "License");
20+
you may not use this file except in compliance with the License.
21+
You may obtain a copy of the License at
22+
23+
http://www.apache.org/licenses/LICENSE-2.0
24+
25+
Unless required by applicable law or agreed to in writing, software
26+
distributed under the License is distributed on an "AS IS" BASIS,
27+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28+
See the License for the specific language governing permissions and
29+
limitations under the License.

README.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -229,13 +229,14 @@ postgresql::server::pg_ident_rule{ 'Map the SSL certificate of the backup server
229229
system_username => 'repli1.example.com',
230230
database_username => 'replication',
231231
}
232+
```
232233

233234
This would create a user name map in `pg_ident.conf` similar to:
234235

235236
```
236-
# Rule Name: Map the SSL certificate of the backup server as a replication user
237-
# Description: none
238-
# Order: 150
237+
#Rule Name: Map the SSL certificate of the backup server as a replication user
238+
#Description: none
239+
#Order: 150
239240
sslrepli repli1.example.com replication
240241
```
241242

@@ -280,10 +281,9 @@ recovery_min_apply_delay = 0
280281

281282
Only the specified parameters are recognized in the template. The `recovery.conf` is only be created if at least one parameter is set **and** [manage_recovery_conf](#manage_recovery_conf) is set to true.
282283

283-
284284
### Validate connectivity
285285

286-
To validate client connections to a remote PostgreSQL database before starting dependent tasks, use the `postgresql::validate_db_connection` resource. You can use this on any node where the PostgreSQL client software is installed. It is often chained to other tasks such as starting an application server or performing a database migration.
286+
To validate client connections to a remote PostgreSQL database before starting dependent tasks, use the `postgresql::validate_db_connection` resource. You can use this on any node where the PostgreSQL client software is installed. It is often chained to other tasks such as starting an application server or performing a database migration.
287287

288288
Example usage:
289289

@@ -299,11 +299,11 @@ exec { 'rake db:migrate':
299299
}
300300
```
301301

302-
## Reference
302+
## Reference
303303

304304
The posgresql module comes with many options for configuring the server. While you are unlikely to use all of the settings below, they provide a decent amount of control over your security settings.
305305

306-
Classes:
306+
**Classes:**
307307

308308
* [postgresql::client](#postgresqlclient)
309309
* [postgresql::globals](#postgresqlglobals)
@@ -316,7 +316,7 @@ Classes:
316316
* [postgresql::server::contrib](#postgresqlservercontrib)
317317
* [postgresql::server::postgis](#postgresqlserverpostgis)
318318

319-
Defined Types:
319+
**Defined Types:**
320320

321321
* [postgresql::server::config_entry](#postgresqlserverconfig_entry)
322322
* [postgresql::server::database](#postgresqlserverdatabase)
@@ -332,13 +332,13 @@ Defined Types:
332332
* [postgresql::server::tablespace](#postgresqlservertablespace)
333333
* [postgresql::validate_db_connection](#postgresqlvalidate_db_connection)
334334

335-
Types:
335+
**Types:**
336336

337337
* [postgresql_psql](#custom-resource-postgresql_psql)
338338
* [postgresql_replication_slot](#custom-resource-postgresql_replication_slot)
339339
* [postgresql_conf](#custom-resource-postgresql_conf)
340340

341-
Functions:
341+
**Functions:**
342342

343343
* [postgresql_password](#function-postgresql_password)
344344
* [postgresql_acls_to_resources_hash](#function-postgresql_acls_to_resources_hashacl_array-id-order_offset)
@@ -367,7 +367,7 @@ Specifies the path to validate the connection script. Default: '/usr/local/bin/v
367367

368368
Installs PostgreSQL bindings for Postgres-Docs. Set the following parameters if you have a custom version you would like to install.
369369

370-
>**Note:** Make sure to add any necessary yum or apt repositories if specifying a custom version.
370+
**Note:** Make sure to add any necessary yum or apt repositories if specifying a custom version.
371371

372372
##### `package_name`
373373

@@ -379,7 +379,7 @@ Whether the PostgreSQL docs package resource should be present. Valid values: 'p
379379

380380
#### postgresql::globals
381381

382-
>**Note:** Most server-specific defaults should be overriden in the `postgresql::server` class. This class should be used only if you are using a non-standard OS, or if you are changing elements that can only be changed here, such as `version` or `manage_package_repo`.
382+
**Note:** Most server-specific defaults should be overriden in the `postgresql::server` class. This class should be used only if you are using a non-standard OS, or if you are changing elements that can only be changed here, such as `version` or `manage_package_repo`.
383383

384384
##### `bindir`
385385

@@ -405,7 +405,7 @@ Overrides the default PostgreSQL contrib package name. Default: OS dependent.
405405

406406
Overrides the default PostgreSQL data directory for the target platform. Default: OS dependent.
407407

408-
>**Note:** Changing the datadir after installation causes the server to come to a full stop before making the change. For RedHat systems, the data directory must be labeled appropriately for SELinux. On Ubuntu, you must explicitly set `needs_initdb = true` to allow Puppet to initialize the database in the new datadir (`needs_initdb` defaults to true on other systems).
408+
**Note:** Changing the datadir after installation causes the server to come to a full stop before making the change. For RedHat systems, the data directory must be labeled appropriately for SELinux. On Ubuntu, you must explicitly set `needs_initdb = true` to allow Puppet to initialize the database in the new datadir (`needs_initdb` defaults to true on other systems).
409409

410410
**Warning:** If datadir is changed from the default, Puppet does not manage purging of the original data directory, which causes it to fail if the data directory is changed back to the original.
411411

@@ -545,11 +545,11 @@ Overrides the `ensure` parameter during package installation. Defaults to `prese
545545

546546
Overrides the default package name for the distribution you are installing to. Defaults to `postgresql-devel` or `postgresql<version>-devel` depending on your distro.
547547

548-
####postgresql::lib::java
548+
#### postgresql::lib::java
549549

550550
Installs PostgreSQL bindings for Java (JDBC). Set the following parameters if you have a custom version you would like to install.
551551

552-
>**Note:** Make sure to add any necessary yum or apt repositories if specifying a custom version.
552+
**Note:** Make sure to add any necessary yum or apt repositories if specifying a custom version.
553553

554554
##### `package_ensure`
555555

@@ -583,7 +583,7 @@ Specifies the name of the postgresql PL/Python package.
583583

584584
Specifies whether the package is present. Valid values: 'present', 'absent'. Default: 'present'.
585585

586-
####postgresql::lib::python
586+
#### postgresql::lib::python
587587

588588
Installs PostgreSQL Python libraries.
589589

@@ -595,7 +595,7 @@ Specifies whether the package is present. Valid values: 'present', 'absent'. Def
595595

596596
The name of the PostgreSQL Python package.
597597

598-
####postgresql::server
598+
#### postgresql::server
599599

600600
##### `createdb_path`
601601

@@ -1094,6 +1094,7 @@ Sets the hash to use during password creation. If the password is not already pr
10941094
postgresql::server::role { "myusername":
10951095
password_hash => postgresql_password('myusername', 'mypassword'),
10961096
}
1097+
```
10971098

10981099
##### `replication`
10991100

@@ -1107,7 +1108,6 @@ Specifies whether to grant super user capability for the new role. Default: fals
11071108

11081109
Defines the username of the role to create. Defaults to the namevar.
11091110

1110-
11111111
#### postgresql::server::schema
11121112

11131113
Creates a schema.

Rakefile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,34 @@ PuppetLint.configuration.send('disable_class_inherits_from_params_class')
99
PuppetLint.configuration.send('disable_documentation')
1010
PuppetLint.configuration.send('disable_single_quote_string_with_variables')
1111
PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp"]
12+
13+
desc 'Generate pooler nodesets'
14+
task :gen_nodeset do
15+
require 'beaker-hostgenerator'
16+
require 'securerandom'
17+
require 'fileutils'
18+
19+
agent_target = ENV['TEST_TARGET']
20+
if ! agent_target
21+
STDERR.puts 'TEST_TARGET environment variable is not set'
22+
STDERR.puts 'setting to default value of "redhat-64default."'
23+
agent_target = 'redhat-64default.'
24+
end
25+
26+
master_target = ENV['MASTER_TEST_TARGET']
27+
if ! master_target
28+
STDERR.puts 'MASTER_TEST_TARGET environment variable is not set'
29+
STDERR.puts 'setting to default value of "redhat7-64mdcl"'
30+
master_target = 'redhat7-64mdcl'
31+
end
32+
33+
targets = "#{master_target}-#{agent_target}"
34+
cli = BeakerHostGenerator::CLI.new([targets])
35+
nodeset_dir = "tmp/nodesets"
36+
nodeset = "#{nodeset_dir}/#{targets}-#{SecureRandom.uuid}.yaml"
37+
FileUtils.mkdir_p(nodeset_dir)
38+
File.open(nodeset, 'w') do |fh|
39+
fh.print(cli.execute)
40+
end
41+
puts nodeset
42+
end

lib/puppet/parser/functions/postgresql_escape.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ module Puppet::Parser::Functions
1111

1212
password = args[0]
1313

14-
if password !~ /\$\$/
14+
if password !~ /\$\$/ and password[-1] != '$'
1515
retval = "$$#{password}$$"
1616
else
1717
escape = Digest::MD5.hexdigest(password)[0..5].gsub(/\d/,'')
@@ -20,6 +20,6 @@ module Puppet::Parser::Functions
2020
end
2121
retval = "$#{escape}$#{password}$#{escape}$"
2222
end
23-
retval
23+
retval
2424
end
2525
end

0 commit comments

Comments
 (0)