Also try giving “{{ user }}” in name section.

Thanks,
Rajas 

> On Feb 4, 2019, at 3:07 PM, Zaineb Masmoudi <[email protected]> wrote:
> 
> Hi all, I'm facing this error while I'm executing my PB: 
> 
> 
> 
> 
> TASK [Exchange intersec keys between servers] 
> ***********************************************************************************************************************************************
> 
> fatal: FAILED! => {"msg": "The task includes an option with an undefined 
> variable. The error was: 'ansible.vars.hostvars.HostVarsVars object' has no 
> attribute 'ssh_keys'\n\nThe error appears to have been in 
> '/home/intersec/dev/project/one/orange-jo-georeach-one/ansible/plays/ansible-bootstrap.yml':
>  line 50, column 7, but may\nbe elsewhere in the file depending on the exact 
> syntax problem.\n\nThe offending line appears to be:\n\n\n    - name: 
> Exchange {{ user }} keys between servers\n      ^ here\nWe could be wrong, 
> but this one looks like it might be an issue with\nmissing quotes.  Always 
> quote template expression brackets when they\nstart a value. For 
> instance:\n\n    with_items:\n      - {{ foo }}\n\nShould be written as:\n\n  
>   with_items:\n      - \"{{ foo }}\"\n"}
>         to retry, use: --limit 
> @/home/intersec/dev/project/one/orange-jo-georeach-one/ansible/plays/ansible-bootstrap.retry
> 
> 
> My PB
> 
>  - name: Exchange {{ user }} keys between servers
>       authorized_key:
>         user: "{{ user }}"
>         key: "{{ hostvars[item]['ssh_keys']['content'] | b64decode }}"
>       with_items: "{{ groups['all'] }}"
>       tags:
>           - ssh_keys
> 
> 
> Could you please help me 
> Thanks in advance !
> 
> -- 
> 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] 
> <mailto:[email protected]>.
> To post to this group, send email to [email protected] 
> <mailto:[email protected]>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/2f1e233c-13eb-4eea-b556-3b308f688082%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/ansible-project/2f1e233c-13eb-4eea-b556-3b308f688082%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
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/2F51556D-B494-47B0-875C-DD269197A0EE%40pluribusnetworks.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to