在课堂上,我想这样做:
stop a service
reinstall a package
start the previous service again
这是我的课:
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"]
}
}
我收到了这个错误:
重复定义:Service[ServiceName] 已在文件 /puppet/mycsass.pp 第 2 行定义;无法在 /puppet/myclass.pp:9 处重新定义