When attempting to disable a service that doesn't exist on a machine, Puppet throws an error:
{noformat} Error: /Stage[main]/module::Disable_cups/Service[cups]: Could not evaluate: Could not find init script or upstart conf file for 'cups' {noformat}
{code:ruby} service {'cups': enable => false, } {code}
It seems to me that there should be a way to suppress this error, as there are cases in which disabled is the goal, but completely missing is also fine. This to me would be more in-line with the package {{Package}} module behavior, where you can say {{ensure => absent}} and it won't throw an error if the package already didn't exist.
When attempting to disable a service that doesn't exist on a machine, Puppet throws an error:
{noformat} Error: /Stage[main]/module::Disable_cups/Service[cups]: Could not evaluate: Could not find init script or upstart conf file for 'cups' {noformat}
{code:ruby} service {'cups': enable => false, } {code}
It seems to me that there should be a way to suppress this error, as there are cases in which disabled is the goal, but completely missing is also fine. This to me would be more in-line with the package behavior, where you can say {{ensure => absent}} and it won't throw an error if the package already didn't exist.
I can't reproduce this problem. PUP-6822 also shows it's working as expected for linux, but wasn't for windows, so I'm assuming this was fixed in between:
# /usr/bin/systemctl is-enabled -- cups
Failed to get unit file state for cups.service: No such file or directory
# cat manifest.pp
service {'cups':
enable => false,
}
# puppet apply manifest.pp
Notice: Compiled catalog for XXX in environment production in 0.17 seconds