Skip to content

Commit

Permalink
Avoid processing files under templates
Browse files Browse the repository at this point in the history
Fixes: #1753
  • Loading branch information
ssbarnea committed Mar 18, 2022
1 parent dbd10e7 commit dda82a9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions examples/templates/playbooks/playbook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# even if is hosted under playbooks and is named playbook.yml, this file
# is not a real playbook because it is hosted in a "templates" directory
# and that means we will avoid processing it as a playbook. Templates use
# either jinja2 or another templating engine, so we cannot load them.
foo: bar
1 change: 1 addition & 0 deletions src/ansiblelint/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# Do not sort this list, order matters.
{"jinja2": "**/*.j2"}, # jinja2 templates are not always parsable as something else
{"jinja2": "**/*.j2.*"},
{"text": "**/templates/**/*.*"}, # templates are likely not validable
{"inventory": "**/inventory/**.yml"},
{"requirements": "**/meta/requirements.yml"}, # v1 only
# https://docs.ansible.com/ansible/latest/dev_guide/collections_galaxy_meta.html
Expand Down

0 comments on commit dda82a9

Please sign in to comment.