I would like to do this:
stop a service
reinstall a package
start the previous service again
I have defines my class:
class MyClass{
service{"ServiceName-start":
name => "ServiceName",
ensure => "stopped",
}
package{"PackageName":
ensure => "installed",
require => Service["ServiceName-Start"],
}
service{"ServiceName-Stop":
name => "ServiceName",
ensure => "running",
require => Package["PackageName"]
}
}
I get the following error:
Duplicate definition: Service[ServiceName] is already defined