[root@cloud ~]# puppet resource service puppet enable=delayedError: Could not set 'delayed' on enable: undefined method `delayed_start' for Service[puppet](provider=systemd):Puppet::Type::Service::ProviderSystemd Error: Could not set 'delayed' on enable: undefined method `delayed_start' for Service[puppet](provider=systemd):Puppet::Type::Service::ProviderSystemd Wrapped exception: undefined method `delayed_start' for Service[puppet](provider=systemd):Puppet::Type::Service::ProviderSystemd Error: /Service[puppet]/enable: change from 'true' to 'delayed' failed: Could not set 'delayed' on enable: undefined method `delayed_start' for Service[puppet](provider=systemd):Puppet::Type::Service::ProviderSystemd service { 'puppet': enable => 'true', provider => 'systemd', }
[root@cloud ~]# puppet resource service puppet enable=delayedError: Could not set 'delayed' on enable: undefined method `delayed_start' for Service[puppet](provider=systemd):Puppet::Type::Service::ProviderSystemd Error: Could not set 'delayed' on enable: undefined method `delayed_start' for Service[puppet](provider=systemd):Puppet::Type::Service::ProviderSystemd Wrapped exception: undefined method `delayed_start' for Service[puppet](provider=systemd):Puppet::Type::Service::ProviderSystemd Error: /Service[puppet]/enable: change from 'true' to 'delayed' failed: Could not set 'delayed' on enable: undefined method `delayed_start' for Service[puppet](provider=systemd):Puppet::Type::Service::ProviderSystemd service { 'puppet': enable => 'true',
provider => 'systemd', }{code}
Wouldn’t it be nicer if {{enable=>delayed}} resolved to {{enable=>true}} on Linux? That would prevent the user from having to creating extra Puppet logic for this parameter in cross-platform scenarios. If not, the resource should at least return a proper error that {{delayed}} is not supported on Linux. /cc: [~kevin.reeuwijk]
The delayed property is missing the required_features part (like we due for mask). That way the property can only be set to that value if the provider supports the feature.
Due to missing required features, error with unwanted message was given when trying to set a service to `delayed_start` on other operating systems than Windows. This fix improves Puppet's behaviour and the error message.