I'm used to see Ansible examples as:
- file: path=/tmp/file state=touch
but someone at work told me that I should be consistent using only YAML syntax like this:
- file:
path: /tmp/file
state: touch
or,
- file: {path: /tmp/file, state:touch}
Which one satisfies Ansible best practices?
Taken from https://www.ansible.com/blog/ansible-best-practices-essentials
Here is an example of some tasks using the key=value shorthand:
Now here is the same tasks using native YAML syntax: