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 edc0e04 commit 4b7518e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions .config/dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ synchronize
sysvinit
taskimports
taskincludes
templating
testmon
testns
testpath
Expand Down
6 changes: 6 additions & 0 deletions examples/templates/playbooks/playbook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
# 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 4b7518e

Please sign in to comment.