copy without need to specify parent directory

“copy” action allows us to copy but the parent directory has to be present on server to succesfully execute action. Same for rsync.

Is there a way to copy file from client to server even when parent directory has not yet been created?

so far i have to run:
shell: mkdir -p /path

then run:
action: copy or local_action: rsync

Is there any way to eliminate first step mkdir?

We generally like the destination directory to have to exist (i.e. be specified with the file module, no need for the mkdir call) so you have the opportunity to consider ownership.

–Michael