Merge pull request #453 from kbarber/maint/master/latest-fedora-no-sysconfig

Fix Fedora support by configuring systemd, not /etc/sysconfig
This commit is contained in:
Ashley Penney 2014-07-25 09:11:30 -04:00
commit 4345749a71
3 changed files with 21 additions and 2 deletions

View file

@ -101,7 +101,7 @@ class postgresql::server::config {
# RedHat-based systems hardcode some PG* variables in the init script, and need to be overriden
# in /etc/sysconfig/pgsql/postgresql. Create a blank file so we can manage it with augeas later.
if ($::osfamily == 'RedHat') and ($::operatingsystemrelease !~ /^7/) {
if ($::osfamily == 'RedHat') and ($::operatingsystemrelease !~ /^7/) and ($::operatingsystem != 'Fedora') {
file { '/etc/sysconfig/pgsql/postgresql':
ensure => present,
replace => false,

View file

@ -30,7 +30,7 @@ define postgresql::server::config_entry (
# have to create a systemd override for the port or update the sysconfig
# file.
if $::osfamily == 'RedHat' {
if $::operatingsystemrelease =~ /^7/ {
if $::operatingsystemrelease =~ /^7/ or $::operatingsystem == 'Fedora' {
if $name == 'port' {
file { 'systemd-port-override':
ensure => present,

View file

@ -62,6 +62,25 @@ describe 'postgresql::server::config_entry', :type => :define do
end
let(:params) {{ :ensure => 'present', :name => 'port', :value => '5432' }}
it 'stops postgresql and changes the port' do
is_expected.to contain_file('systemd-port-override')
is_expected.to contain_exec('restart-systemd')
end
end
context 'fedora 19' do
let :facts do
{
:osfamily => 'RedHat',
:operatingsystem => 'Fedora',
:operatingsystemrelease => '19',
:kernel => 'Linux',
:concat_basedir => tmpfilename('contrib'),
:id => 'root',
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
let(:params) {{ :ensure => 'present', :name => 'port', :value => '5432' }}
it 'stops postgresql and changes the port' do
is_expected.to contain_file('systemd-port-override')
is_expected.to contain_exec('restart-systemd')