忽略包含的yaml文件的错误

时间:2016-01-12 20:00:18

标签: yaml ansible

我有以下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文件的错误?

1 个答案:

答案 0 :(得分:3)

yaml文件中的语法错误。修正了它。

- include: additional.yml
  ignore_errors: yes