Got it. I used the wrong loop construct.  Should have used with_subelements 
with a different input dict.  

On Friday, June 13, 2014 1:58:18 PM UTC-7, zperry wrote:
>
>  I have the following simple test playbook, t.yml
>
> ---
> - hosts: nb3
>   user: root
>   vars_files: 
>    - 'vars/users.yml'
>
>   tasks:
>    - name: Setup | authorized key upload
>      authorized_key:
>      user='{{ item.key }}'
>      *key="{{ lookup('file', 'files/{{ item.key }}/id_rsa.pub') }}"*
>      path='/home/{{ item.key }}/.ssh/authorized_keys'
>      manage_dir=no
>    with_dict: users
>
> Where the users.yml resides in the `pwd`/vars subdirectory as
>
> ---
>
> users:
>    testuser:
>      name: 'Test User'
>      passwd: '$6$Q.....'
>
> But, when I ran ansible-playbook t.yml -v, the key was always "". As a 
> result, the authorized_key is not installed for the test user.  I suspect 
> that the way I constructed the key for the authorized_key module is 
> wrong. But since I am iterating over a dict, what options do I have?  I 
> would appreciate a suggestion for either a correction or a working 
> alternative.
>
> -- Zack
>
>
>

-- 
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-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/bc779047-1dc6-4bb6-9404-adef4ef5984c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to