Skip to content

Commit

Permalink
Fix Ubuntu 15.04 postfix provider fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zuazo committed Sep 16, 2015
1 parent cadff9e commit 2d42783
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 4 additions & 2 deletions recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,10 @@
include_recipe 'postfix::default'

# Fix Ubuntu 15.04 support:
r = resources(service: 'postfix')
r.provider(Chef::Provider::Service::Debian)
if node['platform'] == 'ubuntu' && node['platform_version'].to_i >= 15
r = resources(service: 'postfix')
r.provider(Chef::Provider::Service::Debian)
end
end

#==============================================================================
Expand Down
5 changes: 5 additions & 0 deletions test/unit/recipes/default_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,11 @@
ChefSpec::SoloRunner.new(platform: 'centos', version: '6.0')
end

it 'does not use Debian service provider for postfix' do
expect(chef_run).to enable_service('postfix')
.with_provider(nil)
end

it 'creates www/html directory' do
expect(chef_run).to create_directory('/var/www/html')
end
Expand Down

0 comments on commit 2d42783

Please sign in to comment.