Skip to content

Commit 8d14bde

Browse files
authored
Avoid processing files under templates (#2021)
1 parent edc0e04 commit 8d14bde

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

.config/dictionary.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ synchronize
161161
sysvinit
162162
taskimports
163163
taskincludes
164+
templating
164165
testmon
165166
testns
166167
testpath
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
# even if is hosted under playbooks and is named playbook.yml, this file
3+
# is not a real playbook because it is hosted in a "templates" directory
4+
# and that means we will avoid processing it as a playbook. Templates use
5+
# either jinja2 or another templating engine, so we cannot load them.
6+
foo: bar

src/ansiblelint/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
# Do not sort this list, order matters.
1010
{"jinja2": "**/*.j2"}, # jinja2 templates are not always parsable as something else
1111
{"jinja2": "**/*.j2.*"},
12+
{"text": "**/templates/**/*.*"}, # templates are likely not validable
1213
{"inventory": "**/inventory/**.yml"},
1314
{"requirements": "**/meta/requirements.yml"}, # v1 only
1415
# https://docs.ansible.com/ansible/latest/dev_guide/collections_galaxy_meta.html

0 commit comments

Comments
 (0)