我希望在另一台服务器(服务器A)上更改文件时更新服务器(服务器B)上的服务。我正在使用PuppetDB的存储配置 当我执行类似下面的代码时,我收到以下错误消息
SERVER上的错误400:无效关系:文件[/etc/test.txt] {notify =>执行[command_on different_server]},因为Exec [command_on different_server]已导出但未收集
我是否在正确的轨道上?我似乎无法弄清楚如何做到这一点。
class serverA {
file { "/etc/test.txt":
mode => 644,
source => "puppet:///modules/nagios/test.txt",
notify => Exec["command_on different_server"],
}
@@exec { "command_on_different_server":
command => "/usr/bin/command_whaterver",
tag => "tag_command",
}
}
class serverB {
Exec <<| tag == "tag_command" |>> {}
}