Skip to content
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
14 changes: 14 additions & 0 deletions manifests/server/instance_reload.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# @param service_reload Overrides the default reload command for your PostgreSQL service.
# @param service_status Overrides the default status check command for your PostgreSQL service.
define postgresql::server::instance_reload (
$service_status = $postgresql::server::service_status,
$service_reload = $postgresql::server::service_reload,
) {
exec { 'postgresql_reload':
path => '/usr/bin:/usr/sbin:/bin:/sbin',
command => $service_reload,
onlyif => $service_status,
refreshonly => true,
require => Class['postgresql::server::service'],
}
}
12 changes: 3 additions & 9 deletions manifests/server/reload.pp
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
# @api private
class postgresql::server::reload {
$service_status = $postgresql::server::service_status
$service_reload = $postgresql::server::service_reload

exec { 'postgresql_reload':
path => '/usr/bin:/usr/sbin:/bin:/sbin',
command => $service_reload,
onlyif => $service_status,
refreshonly => true,
require => Class['postgresql::server::service'],
postgresql::server::instance_reload { 'main':
service_status => $postgresql::server::service_status,
service_reload => $postgresql::server::service_reload,
}
}
23 changes: 23 additions & 0 deletions spec/defines/server/instance_reload.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# frozen_string_literal: true

require 'spec_helper'

describe 'postgresql::server::instance_reload' do
let(:title) { 'main' }

on_supported_os.each do |os, os_facts|
context "on #{os}" do
let :facts do
os_facts
end

let :pre_condition do
"class {'postgresql::server':}"
end

context 'with defaults from server class' do
it { is_expected.to compile.with_all_deps }
end
end
end
end