gpt4 book ai didi

error-handling - Ansible : ignoring erros in include tasks

转载 作者:行者123 更新时间:2023-12-03 07:48:26 24 4
gpt4 key购买 nike

我在yml中包含一个特定的yml,可以添加ignore_erors,例如:

include: ../test.tml
ignore_errors: yes
或仅在我自己包含的剧本中
谢谢。

最佳答案

Playbook keywords可以应用于4个对象:播放,角色,块,任务。 ignore_errors可以应用于所有这些。

正确的语法
在您的示例中,包含是一项任务。正确的语法是

- include: ../test.yml
ignore_errors: yes

已弃用include
include - Include a play or task list报价

The include action was too confusing, dealing with both plays and tasks, being both dynamic and static. This module will be removed in version 2.8. As alternatives use include_tasks, import_playbook, import_tasks.

关于error-handling - Ansible : ignoring erros in include tasks,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64300950/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com