Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(MODULES-2181) Fix variable scope for systemd-override #659

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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,10 @@
## 2015-07-01 - Supported Release 4.4.1
### Summary
This release fixes RHEL 7 & Fedora with manage_package_repo switched on.

#### Bugfixes
- Ensure manage_package_repo variable is in scope for systemd-override file for RHEL7

## 2015-06-30 - Supported Release 4.4.0
### Summary
This release has several new features, bugfixes, and test improvements.
Expand Down
1 change: 1 addition & 0 deletions manifests/server/config.pp
Expand Up @@ -14,6 +14,7 @@
$user = $postgresql::server::user
$group = $postgresql::server::group
$version = $postgresql::server::_version
$manage_package_repo = $postgresql::server::manage_package_repo
$manage_pg_hba_conf = $postgresql::server::manage_pg_hba_conf
$manage_pg_ident_conf = $postgresql::server::manage_pg_ident_conf
$manage_recovery_conf = $postgresql::server::manage_recovery_conf
Expand Down
55 changes: 55 additions & 0 deletions spec/unit/classes/server/config_spec.rb
@@ -0,0 +1,55 @@
require 'spec_helper'

describe 'postgresql::server::config', :type => :class do
let (:pre_condition) do
"include postgresql::server"
end

describe 'on RedHat 7' do
let :facts do
{
:osfamily => 'RedHat',
:operatingsystem => 'CentOS',
:operatingsystemrelease => '7.0',
:concat_basedir => tmpfilename('server'),
:kernel => 'Linux',
:id => 'root',
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
it 'should have the correct systemd-override file' do
is_expected.to contain_file('systemd-override').with ({
:ensure => 'present',
:path => '/etc/systemd/system/postgresql.service',
:owner => 'root',
:group => 'root',
})
is_expected.to contain_file('systemd-override') \
.with_content(/postgresql.service/)
end

describe 'with manage_package_repo => true and a version' do
let (:pre_condition) do
<<-EOS
class { 'postgresql::globals':
manage_package_repo => true,
version => '9.4',
}->
class { 'postgresql::server': }
EOS
end

it 'should have the correct systemd-override file' do
is_expected.to contain_file('systemd-override').with ({
:ensure => 'present',
:path => '/etc/systemd/system/postgresql-9.4.service',
:owner => 'root',
:group => 'root',
})
is_expected.to contain_file('systemd-override') \
.with_content(/postgresql-9.4.service/)
end
end
end
end