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:
commit
4345749a71
3 changed files with 21 additions and 2 deletions
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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')
|
||||
|
|
Loading…
Reference in a new issue