Ich habe folgende Aufgabe in meiner Playbooks:Yamllint Einrückungen Warnung auf Valid ansible Code
- 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
Dies als von https://github.com/ansible/ansible/blob/devel/lib/ansible/plugins/lookup/first_found.py korrekt ist.
Yamllint gibt mir die folgende Fehlermeldung:
10:7 warning wrong indentation: expected 8 but found 6 (indentation)
18:7 warning wrong indentation: expected 8 but found 6 (indentation)
Warum Yamllint beschwert sich hier und wie kann ich es korrigieren, so dass es während entspricht immer noch eine gültige ansible Aufgabe zu sein?
Wir haben weg tatsächlich umgerechnet von dass- die beiden zusätzlichen Leerzeichen entfernen. Mit Pythons yamblint [die Config ist] (http://yamblint.readthedocs.io/en/latest/rules.html#module-yamblint.rules.indentation) 'indent-sequences: false' – tedder42