Skip to content

Commit 4345749

Browse files
author
Ashley Penney
committed
Merge pull request puppetlabs#453 from kbarber/maint/master/latest-fedora-no-sysconfig
Fix Fedora support by configuring systemd, not /etc/sysconfig
2 parents 07b8ac4 + 0c4f2a9 commit 4345749

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

manifests/server/config.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101

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

manifests/server/config_entry.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
# have to create a systemd override for the port or update the sysconfig
3131
# file.
3232
if $::osfamily == 'RedHat' {
33-
if $::operatingsystemrelease =~ /^7/ {
33+
if $::operatingsystemrelease =~ /^7/ or $::operatingsystem == 'Fedora' {
3434
if $name == 'port' {
3535
file { 'systemd-port-override':
3636
ensure => present,

spec/unit/defines/server/config_entry_spec.rb

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,25 @@
6262
end
6363
let(:params) {{ :ensure => 'present', :name => 'port', :value => '5432' }}
6464

65+
it 'stops postgresql and changes the port' do
66+
is_expected.to contain_file('systemd-port-override')
67+
is_expected.to contain_exec('restart-systemd')
68+
end
69+
end
70+
context 'fedora 19' do
71+
let :facts do
72+
{
73+
:osfamily => 'RedHat',
74+
:operatingsystem => 'Fedora',
75+
:operatingsystemrelease => '19',
76+
:kernel => 'Linux',
77+
:concat_basedir => tmpfilename('contrib'),
78+
:id => 'root',
79+
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
80+
}
81+
end
82+
let(:params) {{ :ensure => 'present', :name => 'port', :value => '5432' }}
83+
6584
it 'stops postgresql and changes the port' do
6685
is_expected.to contain_file('systemd-port-override')
6786
is_expected.to contain_exec('restart-systemd')

0 commit comments

Comments
 (0)