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.49k stars 663 forks source link

no-name: Name all plays and task blocks #2171

Closed cidrblock closed 2 years ago

cidrblock commented 2 years ago

Starting to pull in possible rule ideas from the community of practice: https://github.com/redhat-cop/automation-good-practices/pull/64

In #2169 it is suggested that all tasks have a name.

This extends that to cover plays and task blocks.

ssbarnea commented 2 years ago

@cidrblock Here are few things I found so far:

WDYT?

cidrblock commented 2 years ago

IMHO, the name for an import playbook and block is equally important, it's unfortunate it doesn't show when the playbook is run, but when looking through the content to better understand what is going on and the original author's intent they can be really useful.

I find import_playbook and a block to be even more complex sometimes than a simple task (e.g. set_fact, debug) , so maybe it's even a little more important to have them here. I'm sure the "next developer" would appreciate the details, I would.