【问题标题】:Echo messages from a script run by Puppet从 Puppet 运行的脚本中回显消息
【发布时间】:2016-11-08 17:18:33
【问题描述】:

我正在编写一个 bash 脚本,它将由 puppet 由 Exec 资源运行(我知道。这并不理想)。我想知道是否可以在脚本中创建调试消息。通常在 Bash 中我使用 echo,在清单中我使用 notify。但是当脚本在 Puppet 中作为 Exec 资源执行时,echo 似乎不起作用。

【问题讨论】:

    标签: bash puppet


    【解决方案1】:

    在此处查看文档以获取 logoutput 属性:https://docs.puppet.com/puppet/latest/reference/types/exec.html#exec-attribute-logoutput

    在将logoutput 设置为true 的Puppet 代理执行期间,您始终可以在脚本中看到echo 的输出。

    例如:

    exec { '/bin/sh script.sh': logoutput => true }
    

    【讨论】:

      猜你喜欢
      • 2016-08-06
      • 2023-03-20
      • 1970-01-01
      • 1970-01-01
      • 2014-02-10
      • 2019-01-08
      • 2016-09-11
      • 1970-01-01
      • 2017-05-16
      相关资源
      最近更新 更多