Puppet:err:/Exec/returns:从 notrun 更改为 0 失败:命令超出超时

Puppet:err:/Exec/returns:从 notrun 更改为 0 失败:命令超出超时

我正在尝试使用 puppet 和我的自定义 shell 脚本在我的服务器上安装 Nagios。一切正常,但我在 puppet 脚本执行结束时看到一个错误,如下所示:

[root@localhost tmp]# /usr/local/bin/puppet --verbose nagiosscript.pp
....
.... Lines of verbose output
....
info: Scope(Class[main]): installing Nagios agent in /usr/local/nagios
info: Applying configuration version '1016779459'
notice: /Stage[main]//Exec[/tmp/check_server.sh]/returns: executed successfully
notice: /Stage[main]//File[/tmp/temporary_mount]/ensure: created
notice: /Stage[main]//Exec[mount]/returns: executed successfully
notice: /Stage[main]//Exec[retrieve_nagios_install_script]/returns: executed successfully
notice: /Stage[main]//File[/var/tmp/nagios_install.sh]/mode: mode changed '644' to '700'

err: /Stage[main]//Exec[/var/tmp/nagios_install.sh]/returns: change from notrun to 0 failed: Command exceeded timeout at /tmp/nagiosscript.pp:34

notice: Finished catalog run in 332.42 seconds

我不确定这个错误意味着什么,但 nagios 安装顺利。

答案1

这是一个众所周知的事实

默认情况下,puppet 会等待 300 秒来完成任务,如果没有完成,那么您只会看到如上所示的错误。您可以定义暂停在您的 Puppet 脚本中使用以下内容

timeout => 0,

来自 Puppet 文档:

Timeout
The maximum time the command should take. If the command takes longer than the timeout, 
the command is considered to have failed and will be stopped. 
The timeout is specified in seconds. The default timeout is 300 seconds and 
you can set it to 0 to disable the timeout.

相关内容