Error while executing my PB

16 views
Skip to first unread message

Zaineb Masmoudi

unread,
Feb 4, 2019, 4:37:41 AM2/4/19
to Ansible Project
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 !

Rajas Pachipulusu

unread,
Feb 4, 2019, 4:42:04 AM2/4/19
to ansible...@googlegroups.com
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 

--
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/2f1e233c-13eb-4eea-b556-3b308f688082%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rajas Pachipulusu

unread,
Feb 4, 2019, 4:43:56 AM2/4/19
to ansible...@googlegroups.com
Also try giving “{{ user }}” in name section.

Thanks,
Rajas 

On Feb 4, 2019, at 3:07 PM, Zaineb Masmoudi <masmoud...@gmail.com> wrote:

Reply all
Reply to author
Forward
0 new messages