# Error while executing my PB

**URL:** <https://forum.ansible.com/t/error-while-executing-my-pb/29608>\
**Category:** Ansible Project\
**Created:** [February 4, 2019, 9:37am UTC](https://forum.ansible.com/t/error-while-executing-my-pb/29608 "2019-02-04T09:37:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zaineb\_Masmoudi](https://avatars.discourse-cdn.com/v4/letter/z/a5b964/32.png) [@Zaineb\_Masmoudi](https://forum.ansible.com/u/Zaineb_Masmoudi)\
**Post date:** [February 4, 2019, 9:37am UTC](https://forum.ansible.com/t/error-while-executing-my-pb/29608/1 "2019-02-04T09:37:41Z")

</div>

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 !

---

<div class="post-metadata">

**Author:** ![rpachi](https://avatars.discourse-cdn.com/v4/letter/r/b5e925/32.png) [@rpachi](https://forum.ansible.com/u/rpachi)\
**Post date:** [February 4, 2019, 9:41am UTC](https://forum.ansible.com/t/error-while-executing-my-pb/29608/2 "2019-02-04T09:41:51Z")

</div>

Where is your authorized\_key module? Have you provided correct module path in ansible.cfg file?

If you have not provided proper path, provide it in ansible.cfg file in library section.

Sample

#library = /var/lib/awx/projects/test-ansible/modules/

Thanks,  
Rajas

---

<div class="post-metadata">

**Author:** ![rpachi](https://avatars.discourse-cdn.com/v4/letter/r/b5e925/32.png) [@rpachi](https://forum.ansible.com/u/rpachi)\
**Post date:** [February 4, 2019, 9:43am UTC](https://forum.ansible.com/t/error-while-executing-my-pb/29608/3 "2019-02-04T09:43:45Z")

</div>

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

Thanks,  
Rajas
