Skip to content

Commit 50226f2

Browse files
authored
Merge branch 'main' into unbreak-debian-support-with-encoding
2 parents e74c6b0 + 880a6f7 commit 50226f2

16 files changed

+93
-29
lines changed

.github/workflows/labeller.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- opened
77
- labeled
88
- unlabeled
9-
pull_request_target:
9+
pull_request:
1010
types:
1111
- opened
1212
- labeled

.github/workflows/mend.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
name: "mend"
22

33
on:
4-
pull_request_target:
5-
types:
6-
- opened
7-
- synchronize
4+
pull_request:
5+
branches:
6+
- "main"
87
schedule:
98
- cron: "0 0 * * *"
109
workflow_dispatch:

CHANGELOG.md

+20-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file.
55

66
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org).
77

8+
## [v10.3.0](https://github.com/puppetlabs/puppetlabs-postgresql/tree/v10.3.0) - 2024-05-08
9+
10+
[Full Changelog](https://github.com/puppetlabs/puppetlabs-postgresql/compare/v10.2.0...v10.3.0)
11+
12+
### Added
13+
14+
- allow puppet-systemd version 7 [#1595](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1595) ([TheMeier](https://github.com/TheMeier))
15+
16+
### Fixed
17+
18+
- Fix instance reload [#1588](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1588) ([SimonHoenscheid](https://github.com/SimonHoenscheid))
19+
820
## [v10.2.0](https://github.com/puppetlabs/puppetlabs-postgresql/tree/v10.2.0) - 2024-04-11
921

1022
[Full Changelog](https://github.com/puppetlabs/puppetlabs-postgresql/compare/v10.1.0...v10.2.0)
@@ -65,6 +77,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
6577
[Full Changelog](https://github.com/puppetlabs/puppetlabs-postgresql/compare/v9.2.0...v10.0.0)
6678

6779
### Changed
80+
6881
- postgis: Drop EL5 leftovers and fix package name for Fedora [#1521](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1521) ([bastelfreak](https://github.com/bastelfreak))
6982
- Drop EoL SLES 11.4 code [#1520](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1520) ([bastelfreak](https://github.com/bastelfreak))
7083
- Drop code for Debian without systemd [#1514](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1514) ([bastelfreak](https://github.com/bastelfreak))
@@ -165,6 +178,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
165178
[Full Changelog](https://github.com/puppetlabs/puppetlabs-postgresql/compare/v8.3.0...v9.0.0)
166179

167180
### Changed
181+
168182
- (CONT-792) - Add Puppet 8/Drop Puppet 6 [#1414](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1414) ([jordanbreen28](https://github.com/jordanbreen28))
169183

170184
## [v8.3.0](https://github.com/puppetlabs/puppetlabs-postgresql/tree/v8.3.0) - 2023-04-21
@@ -244,14 +258,15 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
244258
[Full Changelog](https://github.com/puppetlabs/puppetlabs-postgresql/compare/v7.5.0...v8.0.0)
245259

246260
### Changed
261+
247262
- Support setting default_privileges on all schemas [#1298](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1298) ([fish-face](https://github.com/fish-face))
248263

249264
### Added
250265

251266
- add default version for Fedora 35 [#1317](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1317) ([jflorian](https://github.com/jflorian))
252267
- add scram-sha-256 support [#1313](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1313) ([fe80](https://github.com/fe80))
253268
- add support for Ubuntu Hirsute and Impish [#1312](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1312) ([nicholascioli](https://github.com/nicholascioli))
254-
- Allow systemd to mask postgresql service file [#1310](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1310) ([kim-sondrup](https://github.com/kim-sondrup))
269+
- Allow systemd to mask postgresql service file [#1310](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1310) ([kimsondrup](https://github.com/kimsondrup))
255270
- Make ::contrib a noop on OSes without a contrib package [#1309](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1309) ([carlosduelo](https://github.com/carlosduelo))
256271
- pdksync - (IAC-1753) - Add Support for AlmaLinux 8 [#1308](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1308) ([david22swan](https://github.com/david22swan))
257272
- MODULES-11201: add service_name for Ubuntu 18.04 and later [#1306](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1306) ([moritz-makandra](https://github.com/moritz-makandra))
@@ -354,6 +369,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
354369
[Full Changelog](https://github.com/puppetlabs/puppetlabs-postgresql/compare/v6.10.2...v7.0.0)
355370

356371
### Changed
372+
357373
- pdksync - (MAINT) Remove SLES 11 support [#1247](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1247) ([sanfrancrisko](https://github.com/sanfrancrisko))
358374
- pdksync - (MAINT) Remove RHEL 5 family support [#1246](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1246) ([sanfrancrisko](https://github.com/sanfrancrisko))
359375
- pdksync - Remove Puppet 5 from testing and bump minimal version to 6.0.0 [#1238](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1238) ([carabasdaniel](https://github.com/carabasdaniel))
@@ -520,6 +536,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
520536
[Full Changelog](https://github.com/puppetlabs/puppetlabs-postgresql/compare/5.12.1...v6.0.0)
521537

522538
### Changed
539+
523540
- pdksync - (MODULES-8444) - Raise lower Puppet bound [#1070](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1070) ([david22swan](https://github.com/david22swan))
524541
- (maint) remove inconsistent extra variable [#1044](https://github.com/puppetlabs/puppetlabs-postgresql/pull/1044) ([binford2k](https://github.com/binford2k))
525542

@@ -618,6 +635,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
618635
[Full Changelog](https://github.com/puppetlabs/puppetlabs-postgresql/compare/5.4.0...5.5.0)
619636

620637
### Changed
638+
621639
- Fix creation of recovery.conf file when recovery configuration is not specified [#995](https://github.com/puppetlabs/puppetlabs-postgresql/pull/995) ([cdloh](https://github.com/cdloh))
622640

623641
### Added
@@ -703,6 +721,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
703721
[Full Changelog](https://github.com/puppetlabs/puppetlabs-postgresql/compare/4.9.0...5.0.0)
704722

705723
### Changed
724+
706725
- Unset default log_line_prefix [#870](https://github.com/puppetlabs/puppetlabs-postgresql/pull/870) ([hasegeli](https://github.com/hasegeli))
707726
- Let listen_addresses be defined independently [#865](https://github.com/puppetlabs/puppetlabs-postgresql/pull/865) ([hasegeli](https://github.com/hasegeli))
708727

REFERENCE.md

+27
Original file line numberDiff line numberDiff line change
@@ -1546,6 +1546,7 @@ The following parameters are available in the `postgresql::server::config_entry`
15461546
* [`value`](#-postgresql--server--config_entry--value)
15471547
* [`path`](#-postgresql--server--config_entry--path)
15481548
* [`comment`](#-postgresql--server--config_entry--comment)
1549+
* [`instance_name`](#-postgresql--server--config_entry--instance_name)
15491550

15501551
##### <a name="-postgresql--server--config_entry--ensure"></a>`ensure`
15511552

@@ -1587,6 +1588,14 @@ Defines the comment for the setting. The # is added by default.
15871588

15881589
Default value: `undef`
15891590

1591+
##### <a name="-postgresql--server--config_entry--instance_name"></a>`instance_name`
1592+
1593+
Data type: `String[1]`
1594+
1595+
The name of the instance.
1596+
1597+
Default value: `'main'`
1598+
15901599
### <a name="postgresql--server--database"></a>`postgresql::server::database`
15911600

15921601
Define for creating a database.
@@ -1748,6 +1757,7 @@ The following parameters are available in the `postgresql::server::database_gran
17481757
* [`psql_group`](#-postgresql--server--database_grant--psql_group)
17491758
* [`connect_settings`](#-postgresql--server--database_grant--connect_settings)
17501759
* [`port`](#-postgresql--server--database_grant--port)
1760+
* [`instance`](#-postgresql--server--database_grant--instance)
17511761

17521762
##### <a name="-postgresql--server--database_grant--privilege"></a>`privilege`
17531763

@@ -1815,6 +1825,14 @@ Port to use when connecting.
18151825

18161826
Default value: `$postgresql::server::port`
18171827

1828+
##### <a name="-postgresql--server--database_grant--instance"></a>`instance`
1829+
1830+
Data type: `String[1]`
1831+
1832+
The name of the Postgresql database instance.
1833+
1834+
Default value: `'main'`
1835+
18181836
### <a name="postgresql--server--db"></a>`postgresql::server::db`
18191837

18201838
Define for conveniently creating a role, database and assigning the correct permissions.
@@ -3970,6 +3988,7 @@ The following parameters are available in the `postgresql::server::table_grant`
39703988
* [`psql_user`](#-postgresql--server--table_grant--psql_user)
39713989
* [`connect_settings`](#-postgresql--server--table_grant--connect_settings)
39723990
* [`onlyif_exists`](#-postgresql--server--table_grant--onlyif_exists)
3991+
* [`instance`](#-postgresql--server--table_grant--instance)
39733992

39743993
##### <a name="-postgresql--server--table_grant--privilege"></a>`privilege`
39753994

@@ -4049,6 +4068,14 @@ Create grant only if it doesn't exist.
40494068

40504069
Default value: `false`
40514070

4071+
##### <a name="-postgresql--server--table_grant--instance"></a>`instance`
4072+
4073+
Data type: `String[1]`
4074+
4075+
The name of the Postgresql database instance.
4076+
4077+
Default value: `'main'`
4078+
40524079
### <a name="postgresql--server--tablespace"></a>`postgresql::server::tablespace`
40534080

40544081
This module creates tablespace.

manifests/server/config_entry.pp

+6-4
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@
55
# @param value Defines the value for the setting.
66
# @param path Path for postgresql.conf
77
# @param comment Defines the comment for the setting. The # is added by default.
8+
# @param instance_name The name of the instance.
89
#
910
define postgresql::server::config_entry (
1011
Enum['present', 'absent'] $ensure = 'present',
1112
String[1] $key = $name,
1213
Optional[Variant[String[1], Numeric, Array[String[1]]]] $value = undef,
1314
Stdlib::Absolutepath $path = $postgresql::server::postgresql_conf_path,
1415
Optional[String[1]] $comment = undef,
16+
String[1] $instance_name = 'main',
1517
) {
1618
# Those are the variables that are marked as "(change requires restart)"
1719
# on postgresql.conf. Items are ordered as on postgresql.conf.
@@ -72,15 +74,15 @@
7274
versioncmp($postgresql::server::_version, $requires_restart_until[$key]) < 0
7375
)) {
7476
Postgresql_conf {
75-
notify => Class['postgresql::server::reload'],
77+
notify => Postgresql::Server::Instance::Reload[$instance_name],
7678
}
7779
} elsif $postgresql::server::service_restart_on_change {
7880
Postgresql_conf {
79-
notify => Class['postgresql::server::service'],
81+
notify => Postgresql::Server::Instance::Service[$instance_name],
8082
}
8183
} else {
8284
Postgresql_conf {
83-
before => Class['postgresql::server::service'],
85+
before => Postgresql::Server::Instance::Service[$instance_name],
8486
}
8587
}
8688

@@ -90,6 +92,6 @@
9092
key => $key,
9193
value => $value,
9294
comment => $comment,
93-
require => Class['postgresql::server::initdb'],
95+
require => Postgresql::Server::Instance::Initdb[$instance_name],
9496
}
9597
}

manifests/server/database.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
postgresql_psql { "CREATE DATABASE \"${dbname}\"":
7373
command => "CREATE DATABASE \"${dbname}\" WITH ${template_option} ${encoding_option} ${locale_option} ${tablespace_option}",
7474
unless => "SELECT 1 FROM pg_database WHERE datname = '${dbname}'",
75-
require => Class['postgresql::server::service'],
75+
require => Postgresql::Server::Instance::Service[$instance],
7676
}
7777

7878
# This will prevent users from connecting to the database unless they've been

manifests/server/database_grant.pp

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
# @param psql_group Overrides the default postgres user group to be used for related files in the file system.
1010
# @param connect_settings Specifies a hash of environment variables used when connecting to a remote server.
1111
# @param port Port to use when connecting.
12+
# @param instance The name of the Postgresql database instance.
1213
define postgresql::server::database_grant (
1314
Enum['ALL', 'CREATE', 'CONNECT', 'TEMPORARY', 'TEMP', 'all', 'create', 'connect', 'temporary', 'temp'] $privilege,
1415
String[1] $db,
@@ -19,6 +20,7 @@
1920
Hash $connect_settings = $postgresql::server::default_connect_settings,
2021
String[1] $psql_group = $postgresql::server::group,
2122
Stdlib::Port $port = $postgresql::server::port,
23+
String[1] $instance = 'main',
2224
) {
2325
postgresql::server::grant { "database:${name}":
2426
ensure => $ensure,
@@ -32,5 +34,6 @@
3234
group => $psql_group,
3335
port => $port,
3436
connect_settings => $connect_settings,
37+
instance => $instance,
3538
}
3639
}

manifests/server/db.pp

+3
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
port => $port,
4545
user => $psql_user,
4646
group => $psql_group,
47+
instance => $instance,
4748
}
4849
}
4950

@@ -54,6 +55,7 @@
5455
psql_user => $psql_user,
5556
psql_group => $psql_group,
5657
before => Postgresql::Server::Database[$dbname],
58+
instance => $instance,
5759
}
5860
}
5961

@@ -65,6 +67,7 @@
6567
port => $port,
6668
psql_user => $psql_user,
6769
psql_group => $psql_group,
70+
instance => $instance,
6871
} -> Postgresql_conn_validator<| db_name == $dbname |>
6972
}
7073

manifests/server/instance/config.pp

+2-2
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
group => $group,
8989
mode => '0640',
9090
warn => true,
91-
notify => Class['postgresql::server::reload'],
91+
notify => Postgresql::Server::Instance::Reload[$name],
9292
}
9393

9494
if $pg_hba_conf_defaults {
@@ -249,7 +249,7 @@
249249
group => $group,
250250
mode => '0640',
251251
warn => true,
252-
notify => Class['postgresql::server::reload'],
252+
notify => Postgresql::Server::Instance::Reload[$name],
253253
}
254254
}
255255

manifests/server/instance/reload.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
command => $service_reload,
1212
onlyif => $service_status,
1313
refreshonly => true,
14-
require => Class['postgresql::server::service'],
14+
require => Postgresql::Server::Instance::Service[$name],
1515
}
1616
}

manifests/server/instance/systemd.pp

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
extra_systemd_config => $extra_systemd_config,
3333
}
3434
),
35-
notify => Class['postgresql::server::service'],
36-
before => Class['postgresql::server::reload'],
35+
notify => Postgresql::Server::Instance::Service[$name],
36+
before => Postgresql::Server::Instance::Reload[$name],
3737
}
3838
}
3939
}

manifests/server/table_grant.pp

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# @param psql_user Specifies the OS user for running psql.
1313
# @param connect_settings Specifies a hash of environment variables used when connecting to a remote server.
1414
# @param onlyif_exists Create grant only if it doesn't exist.
15+
# @param instance The name of the Postgresql database instance.
1516
define postgresql::server::table_grant (
1617
Enum['ALL', 'SELECT', 'INSERT', 'UPDATE', 'DELETE', 'TRUNCATE', 'REFERENCES', 'TRIGGER', 'all', 'select', 'insert', 'update', 'delete',
1718
'truncate', 'references', 'trigger'] $privilege,
@@ -24,6 +25,7 @@
2425
Optional[String[1]] $psql_user = undef,
2526
Optional[Hash] $connect_settings = undef,
2627
Boolean $onlyif_exists = false,
28+
String[1] $instance = 'main',
2729
) {
2830
postgresql::server::grant { "table:${name}":
2931
ensure => $ensure,
@@ -37,5 +39,6 @@
3739
psql_user => $psql_user,
3840
onlyif_exists => $onlyif_exists,
3941
connect_settings => $connect_settings,
42+
instance => $instance,
4043
}
4144
}

manifests/server_instance.pp

+17-9
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@
6666
port => $config_settings['port'],
6767
user => $instance_user,
6868
}
69+
postgresql::server::instance::reload { $instance_name:
70+
service_status => $service_settings['service_status'],
71+
service_reload => "systemctl reload ${service_settings['service_name']}.service",
72+
}
6973
postgresql::server::instance::passwd { $instance_name:
7074
* => $passwd_settings,
7175
}
@@ -84,11 +88,12 @@
8488
$value = $settings['value']
8589
$comment = $settings['comment']
8690
postgresql::server::config_entry { "${entry}_${$instance_name}":
87-
ensure => bool2str($value =~ Undef, 'absent', 'present'),
88-
key => $entry,
89-
value => $value,
90-
comment => $comment,
91-
path => $config_settings['postgresql_conf_path'],
91+
ensure => bool2str($value =~ Undef, 'absent', 'present'),
92+
key => $entry,
93+
value => $value,
94+
comment => $comment,
95+
path => $config_settings['postgresql_conf_path'],
96+
instance_name => $instance_name,
9297
}
9398
}
9499
$pg_hba_rules.each |String[1] $rule_name, Postgresql::Pg_hba_rule $rule| {
@@ -108,10 +113,11 @@
108113
}
109114
$databases.each |$database, $database_details| {
110115
postgresql::server::database { $database:
111-
* => $database_details,
112-
user => $instance_user,
113-
group => $instance_group,
114-
port => $config_settings['port'],
116+
* => $database_details,
117+
user => $instance_user,
118+
group => $instance_group,
119+
port => $config_settings['port'],
120+
instance => $instance_name,
115121
}
116122
}
117123
$database_grants.each |$db_grant_title, $dbgrants| {
@@ -120,13 +126,15 @@
120126
psql_user => $instance_user,
121127
psql_group => $instance_group,
122128
port => $config_settings['port'],
129+
instance => $instance_name,
123130
}
124131
}
125132
$table_grants.each |$table_grant_title, $tgrants| {
126133
postgresql::server::table_grant { $table_grant_title:
127134
* => $tgrants,
128135
psql_user => $instance_user,
129136
port => $config_settings['port'],
137+
instance => $instance_name,
130138
}
131139
}
132140
}

0 commit comments

Comments
 (0)