ansible / ansible-lint

ansible-lint checks playbooks for practices and behavior that could potentially be improved and can fix some of the most common ones for you
https://ansible.readthedocs.io/projects/lint/
GNU General Public License v3.0
3.44k stars 655 forks source link

layout[playbook]: New rule for detection of playbooks outside of a playbooks directory #1900

Open cidrblock opened 2 years ago

cidrblock commented 2 years ago

We should be able to determine with some degree of confidence that a yaml file is a playbook and warn they should be in a ./playbooks directory.

gone-for-coding commented 2 years ago

I just found this feature request while looking at an issue I have with the auto detection mode (see here https://github.com/ansible/ansible-lint/discussions/2166). Isn't there already a playbook detection there:

https://github.com/ansible/ansible-lint/blob/9cc2a955f98852fb1d6c8a3d7e8009df27698915/src/ansiblelint/utils.py#L776

cidrblock commented 2 years ago

https://gist.github.com/cidrblock/87a874b2ac34d894dc56e8451d577eaa

This is related, although I don't think lint can fix it... :)