After a bit of research, I ended up understanding that the problem comes from the sequence that creates the context.
during task execution, "ansible_user" is considered a magic variable, that is created out of "remote_user".
but it is added to the task variables context only after the connection info is built, templated and checked for undefined values.
I suspect this is a bug in the context creation ordering (because this was working with ansible 1.8 with sudo_user: {{ansible_ssh_user}} )
I would appreciate if someone in the ansible team has time to review it and tell me if this has any chance of being merged.
Thanks,