Skip to content

Instantly share code, notes, and snippets.

@kklimonda
Created October 24, 2017 09:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kklimonda/cc23188c5cdb69ff86f5083c16e49e51 to your computer and use it in GitHub Desktop.
Save kklimonda/cc23188c5cdb69ff86f5083c16e49e51 to your computer and use it in GitHub Desktop.
- hosts: localhost
connection: local
tasks:
- name: Create a list of YAML files to validate
find:
paths: .
patterns: "*.yaml"
recurse: true
register: yaml
changed_when: false
- include_tasks: validate_yaml.yaml
with_items: "{{ yaml.files | map(attribute='path') | list }}"
- name: "Validate {{ item }}"
validate_yaml:
path: "{{ item }}"
ignore_errors: True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment