Linter should consider the same paths that ansible.builtin.import_tasks
uses to import relative paths
#4474
Labels
ansible.builtin.import_tasks
uses to import relative paths
#4474
Summary
The
ansible.builtin.import_tasks
module searches a list of directories to find thefile
that should be imported.The linter should consider the same directories as candidate files instead of assuming the file is located in the role's tasks directory.
Issue Type
OS / ENVIRONMENT
STEPS TO REPRODUCE
Clone the reproduction:
git clone https://github.com/agross/ansible-import-path.git
Tye linter is not happy:
The playbook works:
Desired Behavior
The linter should consider the same paths the module considers, i.e. search the
tasks/
directory.Actual Behavior
https://github.com/agross/ansible-import-path
$ ansible-playbook --syntax-check playbook.yml [WARNING]: No inventory was parsed, only implicit localhost is available [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all' playbook: playbook.yml
The text was updated successfully, but these errors were encountered: