在ansible中尝试捕获任务超时 让我们考虑下面的伪可调代码: - name: "some long task which can hang - command: "something" - timeout: 60s - name: "catch in case of failure (in particularity timeout)" - command: "some helpful debug command"
可以在ansible中执行吗?阅读网站上的文档,这些文档允许您执行以下操作:在ansible中尝试捕获任务超时 让我们考虑下面的伪可调代码: - name: "some long task which can hang - command: "something" - timeout: 60s - name: "catch in case of failure (in particularity timeout)" - command: "some helpful debug command",ansible,Ansible,可以在ansible中执行吗?阅读网站上的文档,这些文档允许您执行以下操作: - block: - debug: msg: "This is a basic task that will run in the block" rescue: - debug: msg: "This task will only run if something fails in the main block always: - debug:
- block:
- debug:
msg: "This is a basic task that will run in the block"
rescue:
- debug:
msg: "This task will only run if something fails in the main block
always:
- debug:
msg: "This task always runs, irrespective of whether the tasks in the main block succeed or not"