OMICRON SETUP 0.3
HOME ABOUT ME CONTACT PROJECTS BLOG WEBRING

Where are the ansible-lint docs?

Ansible-lint is a tool for ansible that provides basic linting for your ansible roles. It can be really usefull when you want to make sure your roles adhere to core standards. That can be pretty good, but lets say you want to build your own rules, which define your own standards/linting.
Anyone who ever worked on this for more then a week would agree with me that the documentation for it is shady at best. Let me show you how ansible-lint works, according to their documentation:

  1. Create Python file containg from ansbile-rules import AnsibleLintRule to make sure that ansible-lint recognize it as a new rule.
  2. In that file create new class [name-of-file](AnsibleLintRule), which is used as a holder for the whole rule.
  3. Make variables that hold metadata like id,shordesc,description,etc.
  4. Define functions named either match(to check the role line by line) or matchtask(to check the role by tasks).

But if you know something about ansible, you know that just isn't enough. Things like checking filenames, custom modules, deeper YAML structure etc. are not at all covered in their docs. You can cover these problems with other Python modules, so its not that big of a problem.

What's worse is that they have most of these problems inside their code already. When you read their source code, you can find about 3 more methods to overwrite, many functions to use in their utils and such hidden stuff. I can't wrap my head around why wouldn't write about those things inside their docs.