Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove manual systemd drop-in file handling
* add puppet/systemd module * remove systemd daemon reload and raise minimal puppet version to 6.1 * remove old "drop-in file" removal, was in place 3 years now * move systemd drop-in file handling to seperate define * Implement recent feedback * define is now private * rename parameter in define call * fix unit tests * fix rubocop complains * fix path, set default fact * fix systemd drop in file, adding template parameters to systemd define * added reason for drop in file in a comment * added reviewers feedback * remove ensure parameter for systemd drop-in file handling, except for the define itself. * systemd_extra_args expects String, default is undef now
- Loading branch information
1 parent
42fe0c4
commit 5eb1e8e
Showing
10 changed files
with
75 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# @summary This define handles systemd drop-in files for the postgres main instance (default) or additional instances | ||
# @param service_name Overrides the default PostgreSQL service name. | ||
# @param drop_in_ensure sets the Systemd drop-in file to present or absent | ||
# @api private | ||
define postgresql::server::instance::systemd ( | ||
Variant[String[1], Stdlib::Port] $port, | ||
Stdlib::Absolutepath $datadir, | ||
Optional[String[1]] $extra_systemd_config = undef, | ||
String[1] $service_name = $name, | ||
Enum[present, absent] $drop_in_ensure = 'present', | ||
|
||
) { | ||
# Template uses: | ||
# - $port | ||
# - $datadir | ||
# - $extra_systemd_config | ||
systemd::dropin_file { "${service_name}.conf": | ||
ensure => $drop_in_ensure, | ||
unit => "${service_name}.service", | ||
owner => 'root', | ||
group => 'root', | ||
content => template('postgresql/systemd-override.erb'), | ||
notify => Class['postgresql::server::service'], | ||
before => Class['postgresql::server::reload'], | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters