在 puppet.conf 中执行命令之前,有没有办法将消息打印到控制台?例如,假设我的清单有:
exec {
command => 'mycommandhere'
}
Run Code Online (Sandbox Code Playgroud)
我想打印一条消息,上面写着“运行我的命令”。除了在打印之前调用另一个命令之外,有没有一种简单的方法可以做到这一点?
小智 6
当然,只需将两个资源链接在一起:
notify { 'some-command':
message => 'some-command is going to be executed now'
}
exec { 'some-command':
command => '/path/to/some-command',
}
Notify['some-command'] -> Exec['some-command']
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
10740 次 |
| 最近记录: |