chef-boneyard / chef-init

PID1 for your Chef containers
21 stars 4 forks source link

Patch Chef::Resource::Service 'provider' setter and getter #30

Open alambike opened 9 years ago

alambike commented 9 years ago

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