【发布时间】:2017-11-21 16:16:13
【问题描述】:
我的剧本中有以下任务:
- name: gather os specific variables
include_vars: "{{ item }}"
with_first_found:
- files:
- "{{ ansible_distro }}-{{
ansible_distribution_version|lower|replace('/', '_') }}.yml"
- "{{ ansible_distro }}-{{ ansible_distribution_release }}.yml"
- "{{ ansible_distro }}-{{
ansible_distribution_major_version|lower|replace('/', '_') }}.yml"
- "{{ ansible_distro }}.yml"
- "{{ ansible_os_family|lower }}.yml"
paths:
- ../vars
skip: true
截至https://github.com/ansible/ansible/blob/devel/lib/ansible/plugins/lookup/first_found.py,这是正确的。
Yamllint 给我以下错误:
10:7 warning wrong indentation: expected 8 but found 6 (indentation)
18:7 warning wrong indentation: expected 8 but found 6 (indentation)
为什么 Yamllint 会在这里抱怨,我该如何纠正它以使其符合同时仍然是有效的 Ansible 任务?
【问题讨论】: