I've run into this situation with SuSE. At least with the version of chef i'm using (12.13, not sure about newer versions) seem to get the init determination wrong so the internal test to see if the service is already enabled does not work right.
The most interesting thing about it was that the provider i found to work on SLES 11 was Chef::Provider::Service::Redhat
. I had to handle supporting both 11 and 12 so i ended up using an if block within the resource definition
service 'apache2' do
action [:enable, :start]
if node['init_package'] != 'systemd'
provider Chef::Provider::Service::Redhat
end
end
I just spent the better part of 30 minutes digging through all of my cookbooks trying to find the original, but couldn't, i did just confirm that SLES SP4 exhibits the behavior you described, and that the above fixed it
-----> Converging <default-sles-11-sp4>...
Recipe: apache_test::default
* zypper_package[apache2] action install (up to date)
* service[apache2] action enable (up to date)
* service[apache2] action start (up to date)