Rewrite provider setter and getter to avoid that service resource define in recipes can change provider.
For example this snippet in php5-fpm::install recipe:
#Enable and Restart PHP5-FPM
service node["php_fpm"]["package"] do
#Bug in 14.04 for service provider. Adding until resolved.
if (platform?('ubuntu') && node['platform_version'].to_f >= 14.04)
provider Chef::Provider::Service::Upstart
end
supports :start => true, :stop => true, :restart => true, :reload => true
action [ :enable, :start ]
end
Rewrite provider setter and getter to avoid that service resource define in recipes can change provider.
For example this snippet in php5-fpm::install recipe: