I have this 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"]
}
}
But I end up with an error:
Duplicate definition: Service[ServiceName] is already defined in file /puppet/mycsass.pp at line 2; cannot redefine at /puppet/myclass.pp:9