You can’t use $item to define handler names. It probably should work though (patches accepted). Bonus points on being creative!
The simplest workaround is to leave the fetch actions in the task section.
(B)
The chmod is unnecessary as you can pass the mode to copy or template calls directly. (See the module documentation for “file” and notes
about the copy and template module). In fact, you’re doing this, so I’m not sure why the chmod notify is there.
This characteristics makes playbooks more verbose than they often need to be. I seem to be duplicating a lot of what the actions does in the name, just because I have to provide it.
Most of the actions are self-explanatory, so the need to name each of them is cumbersome at best. From a 'usability' perspective, being able to group sets of actions (without requiring a name for each action) would be a big improvement.
Not setting the request aside, I would require the copy module to work on directories as well (or use globs). The use-case is that a directory with files need to be copied to the servers, and we don't want to list the files additionally in the playbook using with_items.
The files itself are checked-in into the repository together with the playbooks and templates.
Not setting the request aside, I would require the copy module to work on
directories as well (or use globs). The use-case is that a directory with
files need to be copied to the servers, and we don’t want to list the
files additionally in the playbook using with_items.
I don’t see ansible implementing recursive cp, it doesn’t fit in well with the auth system to just invoke
rsync (especially from paramiko or with sudo), and doing it any other way feels like reimplementing rsync.
If you want this, you could transfer a tar ball and explode it, or use the git module to check out a subtree.
Not setting the request aside, I would require the copy module to
work on directories as well (or use globs).
If with_items supported globs (or even reading from a file ‘<’, or pipe
‘|’), that would solve the problem as well, and enhance a lot of
modules:
Just for everyone’s clarification,
with_items is a macro that creates lots of subtasks PRIOR to communication with hosts, it can’t talk to remote hosts, which is why you can’t
use vars_files with it.
Something like supporting an include would definitely be possible (patches accepted)