variable isn't expanded correctly?

98 views
Skip to first unread message

Dario Bertini

unread,
Apr 3, 2014, 12:42:29 PM4/3/14
to ansible...@googlegroups.com
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

Brian Coca

unread,
Apr 4, 2014, 12:51:06 AM4/4/14
to ansible...@googlegroups.com
i don't think the connection module templates that value, also USER would already be the default if you don't specify anything.

Dario Bertini

unread,
Apr 4, 2014, 4:56:52 AM4/4/14
to ansible...@googlegroups.com
You're right, anyhow this is a regression introduced with ansible 1.5.0

Michael DeHaan

unread,
Apr 4, 2014, 11:13:22 AM4/4/14
to ansible...@googlegroups.com
"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.




On Fri, Apr 4, 2014 at 4:56 AM, Dario Bertini <berd...@gmail.com> wrote:
You're right, anyhow this is a regression introduced with ansible 1.5.0

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/a53fa008-066a-4ac0-a8da-919f4e8e9b72%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Dario Bertini

unread,
Apr 4, 2014, 11:23:37 AM4/4/14
to ansible...@googlegroups.com
On Fri, Apr 4, 2014 at 5:13 PM, Michael DeHaan <mic...@ansible.com> wrote:
>
> (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?

--
xmpp: berd...@gmail.com
bitmessage: BM-2cTYXfGiSTsnx3righ6aHcJSWe4MV17jDP
gpg fingerprint: 3F8D53518012716C4EEF7DF67B498306B3BF75A0 (used just
for signing commits)

Michael DeHaan

unread,
Apr 4, 2014, 11:24:29 AM4/4/14
to ansible...@googlegroups.com
Not without modifying the source to fix the root cause of the problem.




--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.

Michael DeHaan

unread,
Apr 4, 2014, 11:24:42 AM4/4/14
to ansible...@googlegroups.com
BTW, please make sure there's a ticket filed for this.

Thanks!
Reply all
Reply to author
Forward
0 new messages