Skip to content

Commit

Permalink
Merge 45939ed into baec950
Browse files Browse the repository at this point in the history
  • Loading branch information
TuningYourCode committed Aug 17, 2019
2 parents baec950 + 45939ed commit 52761cc
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
10 changes: 9 additions & 1 deletion manifests/fpm/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,15 @@
mode => '0644',
}

ensure_resource('file', ['/var/run/php-fpm/', '/var/log/php-fpm/'], {
if (dirname($pid_file) == '/var/run/php-fpm') {
ensure_resource('file', ['/var/run/php-fpm/'], {
ensure => directory,
owner => $user,
group => $group,
})
}

ensure_resource('file', ['/var/log/php-fpm/'], {
ensure => directory,
owner => $user,
group => $group,
Expand Down
20 changes: 20 additions & 0 deletions spec/classes/php_fpm_config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,26 @@
)
end
end

describe 'creates default pid directory' do
let(:params) do
{
pid_file: '/var/run/php-fpm/php-fpm.pid'
}
end

it { is_expected.to contain_file('/var/run/php-fpm/') }
end

describe 'not creates default pid directory with custom pid file path' do
let(:params) do
{
pid_file: '/var/run/php-fpm.pid'
}
end

it { is_expected.not_to contain_file('/var/run/php-fpm/') }
end
end
end
end

0 comments on commit 52761cc

Please sign in to comment.