variable isn't expanded correctly?

Hi, I have a variable set up like this:

ansible_ssh_user: “{{ lookup(‘env’, ‘USER’) }}”

all the commands execute fine, until I get to the point where I want to use the synchronize module, where it fails with:

failed: [vmArServer] => {“failed”: true, “item”: “”}
msg: this module requires key=value arguments ([‘src=…/…/frontEnd/*’, ‘private_key=/home/dario/.vagrant.d/insecure_private_key’, ‘dest_port=22’, ‘recursive=yes’, ‘dest={{lookup(env,’, ‘USER)}}@10.0.46.164:/var/www/nginx’, ‘delete=yes’, ‘archive=yes’, ‘rsync_path=sudo rsync’])

If I change ansible_ssh_user, hardcoding it with my user, it works fine… but “”“{{lookup(env,', 'USER)}}”“” seems really weird: it almost looks like there would be some extra quotes around my lookup, but I reckon that would trigger an error much earlier

Has anyone seen something like this?

Thanks

i don’t think the connection module templates that value, also USER would already be the default if you don’t specify anything.

You’re right, anyhow this is a regression introduced with ansible 1.5.0

“You’re right, anyhow this is a regression introduced with ansible 1.5.0”

(A) I don’t think we can say any possible behavior where something strange used to work and doesn’t is a regression, unless that behavior was either documented or had a unit test for it.

(B) This variable really ought to be templated at an earlier level anyway.

Agree, is there something I could to do force the templating early, or
is it something that can be done only inside ansible itself?

Not without modifying the source to fix the root cause of the problem.

BTW, please make sure there’s a ticket filed for this.

Thanks!