Skip to content

Commit

Permalink
Allow file attribute with ansible.builtin.include_tasks (#2518)
Browse files Browse the repository at this point in the history
Fixes: #2387
  • Loading branch information
ssbarnea authored Sep 29, 2022
1 parent 5006cc4 commit da6e93c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
Empty file.
4 changes: 4 additions & 0 deletions examples/roles/bobbins/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
- name: Test tasks
action: git a=b c=d

- name: Import tasks
ansible.builtin.import_tasks:
file: imported_tasks.yml
8 changes: 7 additions & 1 deletion src/ansiblelint/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,13 @@ def _include_children(
) -> list[Lintable]:
# handle special case include_tasks: name=filename.yml
if (
k in ["include_tasks", "ansible.builtin.include_tasks"]
k
in [
"include_tasks",
"ansible.builtin.include_tasks",
"import_tasks",
"ansible.builtin.import_tasks",
]
and isinstance(v, dict)
and "file" in v
):
Expand Down

0 comments on commit da6e93c

Please sign in to comment.