Hello,
Dag and I pulled straws on who'd write this message, and I lost.
Ansible's original playbook syntax for invoking a module was
- action: modulename ...
This was later augmented to allow omission of the "action" keyword.
- modulename ...
I forget the history of why it was decided to use the second syntax form
in the documentation, but that is the way it currently is (I recently
submitted a huge patch which cleaned that up).
Discussion today brought this topic up again, and a number of people
(myself included) feel that adding the "action:" keyword makes a) more
sense and b) looks better, particularly when mixed with things like
local_action where the latter may *not* be omitted. Compare
- action: copy src=
- action: shell ...
register: var
- local_action: get_url ...
and
- copy: src=
- shell: ...
register: var
- local_action: get_url
(In the latter example, it's difficult to see that 'register' is not a
module ...)
Can we, once in for all, settle this? We are not proposing to disallow
the syntax within the playbook (which would break backwards
compatibility!), but simply trying to establish a "standard" by which we
document things, both in the official Ansible documentation as well as
in whatever other things we write about Ansible.
Whichever method we settle on, I'll gladly go through all the modules
again (*groans*) and fix the EXAMPLES string.
-JP