【问题标题】:Print real time script output running on remote in ansible在ansible中打印远程运行的实时脚本输出
【发布时间】:2019-12-17 23:31:33
【问题描述】:

我正在运行剧本中的 bash 脚本。 bash 脚本在远程机器上依次并行运行多个脚本,并且仅在执行整个剧本时才会在控制台上提供输出。我想实时打印输出。有可能吗?

使用 ansible 提供的“寄存器”存储结果以打印输出在这里没有帮助。因为我需要实时输出。

【问题讨论】:

标签: ansible output


【解决方案1】:

不可能影响当前正在运行的“实时”脚本。

你可以使用 failed_when 来捕捉脚本错误: https://docs.ansible.com/ansible/latest/user_guide/playbooks_error_handling.html#controlling-what-defines-failure

或者你在运行时捕获脚本自身的错误。

【讨论】:

    猜你喜欢
    • 2014-03-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-03-14
    • 1970-01-01
    • 2012-02-18
    • 2019-10-05
    • 1970-01-01
    相关资源
    最近更新 更多