Are there conventions regarding task names, e.g. all examples seem to have an leading lower case letter, but is that a official recommendation ?
All examples I see on ansible website e.g. at https://docs.ansible.com/ansible/latest/user_guide/playbooks_intro.html use this style ...
tasks:
- name: ensure apache is at the latest version
yum:
name: httpd
state: latest
as opposed to Ensure apache is at the latest version
.
However when I use gather_facts: true
in my playbook I see the built-in ansible generated ...
TASK [Gathering Facts]
which seems inconsistent?
I know this may seem trivial point, but if we are writing lots of plays I'd like to ensure we adhere to conventions.
For the moment you are in a good spot if you name all your tasks, regardless how you do it. Ansible-lint can clearly help you achieve that.
Another recommendations I have:
BTW, if you want to propose more restrictive checks for ansible-lint, I will be happy to review your change.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With