如何在ansible playbook上指定每个任务的日志
How to specify log per task on ansible playbook
我有1个角色14个任务,运行宁角色的时候,他们会依次运行14个任务,结果return全部14个任务,有没有其他的我如何让每个任务在 ansible 中都有一个单独的日志文件? ?如果可能的话,请给我看例子,谢谢
您想要的是 stdout callback, of which log_plays
most closely matches your description. However, it is per-host, not per task, so you'll need to copy the code into your playbook as described by developing your own plugin 然后修改它以获得您期望的行为。
我有1个角色14个任务,运行宁角色的时候,他们会依次运行14个任务,结果return全部14个任务,有没有其他的我如何让每个任务在 ansible 中都有一个单独的日志文件? ?如果可能的话,请给我看例子,谢谢
您想要的是 stdout callback, of which log_plays
most closely matches your description. However, it is per-host, not per task, so you'll need to copy the code into your playbook as described by developing your own plugin 然后修改它以获得您期望的行为。