【问题标题】:Ignore errors for included yaml file忽略包含的 yaml 文件的错误
【发布时间】:2016-01-12 20:00:17
【问题描述】:

我有以下 YAML 文件,它引用了另一个我想忽略其错误的 yaml 文件。

---
- hosts: personal
  gather_facts: no
  tasks:
    - name: command1
      command: "nodanger command1"
      register: command1
      ignore_errors: yes
    - debug: var=command1.stdout_lines

-include: additional.yml
   ignore_errors: yes

当我运行上面的剧本时,我收到以下错误

ERROR: Syntax Error while loading YAML script, command.yml
Note: The error may actually appear before this position: line 11, column 1


-include: additional.yml

如何忽略包含的 yml 文件的错误?

【问题讨论】:

    标签: yaml ansible


    【解决方案1】:

    您的 yaml 文件中存在语法错误。修好了。

    - include: additional.yml
      ignore_errors: yes
    

    【讨论】:

    • 修复由于ignore_errors中的冒号而产生以下错误:注意:错误实际上可能出现在此位置之前:第12行,第17列 - 包括:irstatus.yml ignore_errors:yes
    • @Zee 你能用你尝试过的内容更新你的帖子吗?我运行它没有问题。
    猜你喜欢
    • 2014-07-09
    • 2023-02-04
    • 2021-09-19
    • 1970-01-01
    • 2020-06-17
    • 2018-10-11
    • 2018-01-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多