Skip to content

Commit

Permalink
Fix PHP-FPM on Ubuntu 15.04
Browse files Browse the repository at this point in the history
  • Loading branch information
zuazo committed Sep 26, 2015
1 parent cf48390 commit d43a45b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
6 changes: 6 additions & 0 deletions recipes/_php_fpm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,9 @@
)
end
end

# Fix Ubuntu 15.04 support:
if node['platform'] == 'ubuntu' && node['platform_version'].to_i >= 15
r = resources(service: 'php-fpm')
r.provider(Chef::Provider::Service::Debian)
end
19 changes: 19 additions & 0 deletions test/unit/recipes/_php_fpm_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,23 @@
"#{node['php-fpm']['pool_conf_dir']}/owncloud.conf"
)
end

it 'uses the default service provider for php-fpm' do
expect(chef_run).to enable_service('php-fpm')
.with_provider(nil)
end

context 'on Ubuntu 15.04' do
# Ubuntu 15.04 still not supported by fauxhai
before do
node.automatic['platform_family'] = 'debian'
node.automatic['platform'] = 'ubuntu'
node.automatic['platform_version'] = '15.04'
end

it 'uses Debian service provider for php-fpm' do
expect(chef_run).to enable_service('php-fpm')
.with_provider(Chef::Provider::Service::Debian)
end
end # context on Ubuntu 15.04
end

0 comments on commit d43a45b

Please sign in to comment.