Hi! For me it doesn't!
Neither this:
  authorized_key: user=$ENV(USER) key="{{ lookup('file', 
'~/.ssh/id_rsa.pub') }}"
nor this:
  authorized_key: user={{ lookup('env', 'USER') }} key="{{ lookup('file', 
'~/.ssh/id_rsa.pub') }}"

both fail with:
failed: [dev] => {"failed": true, "item": ""}
msg: Failed to lookup user patte: 'getpwnam(): name not found: patte'

I'm patte on OSX, with ansible 1.5.5 fired by vagrant provision
any idea?
  

Am Dienstag, 2. Juli 2013 20:26:17 UTC+2 schrieb Michael DeHaan:
>
> Friendly reminder:
>
> $ENV(USER) as a mechanism of getting lookup plugins is deprecated
>
> We should be instructing folks do to:
>
> {{ lookup('env', 'USER') }}
>
>
>
>
> On Tue, Jul 2, 2013 at 9:40 AM, Mathias Bogaert 
> <[email protected]<javascript:>
> > wrote:
>
>> This works:
>>
>> - name: Make sure my local RSA SSH key is installed
>>   authorized_key: user=$ENV(USER) key="{{ lookup('file', 
>> '~/.ssh/id_rsa.pub') }}"
>>
>> Thanks!!
>>
>> On Tuesday, 2 July 2013 15:38:45 UTC+2, Mathias Bogaert wrote:
>>>
>>> Yeah, it's an Ubuntu 12.10.
>>>
>>> But it works like this:
>>>
>>> - name: Make sure my authorized key is installed
>>>   authorized_key: user=$ENV(USER) key="{{ lookup('file', '/home/' + 
>>> $ENV(USER) + '/.ssh/id_rsa.pub') }}"
>>>
>>> but the key doesn't evaluate. The lookup doesn't work. My remote 
>>> authorized_keys now contains 
>>>
>>> {{lookup('file', '/home/' + mathias + '/.ssh/id_rsa.pub')}}
>>>
>>> which doesn't work...
>>>
>>> On Tuesday, 2 July 2013 15:32:32 UTC+2, JP Mens wrote:
>>>>
>>>> > msg: Failed to lookup user ${ENV(USER)}: 'getpwnam(): name not found: 
>>>> > ${ENV(USER)}' 
>>>> > failed: [hdata01] => {"failed": true, "item": ""} 
>>>>
>>>> getpwnam() failed?! Is this a Unix system you're running on? ;-) 
>>>> What OS/version? 
>>>>
>>>> Can you try 
>>>>
>>>>         - local_action: debug msg="Hello $ENV(HOME)" 
>>>>
>>>> and run ansible-playbook -vvv 
>>>>
>>>>         -JP 
>>>>
>>>  -- 
>> 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 [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>
>
> -- 
> Michael DeHaan <[email protected] <javascript:>>
> CTO, AnsibleWorks, Inc.
> http://www.ansibleworks.com/
>
>  

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/f4947799-2531-442a-9dd4-33c9422ebd73%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to