I had tried but still receive
fatal: [server]: FAILED! => {"changed": false, "msg":
"AnsibleUndefinedVariable: 'dict object' has no attribute
'ssh_host_key_ecdsa_public'"}
> On Jan 3, 2019, at 3:23 PM, Hugo Gonzalez <[email protected]> wrote:
>
>
>
> On 1/3/19 3:34 PM, Freddie Eisa wrote:
>> So it depends on the host and how they are named and was really a test case.
>> The one I’m really concerned about is this one now
>>
>>
>> {% for host in groups['servers_production'] %}
>> {{ hostvars[host]['ssh_host_key_ecdsa_public'] }}
>> {% endfor %}
>
> I think you mean:
> hostvars[host]['ansible_facts']['ssh_host_key_ecdsa_public']
>
> This works for me and prints the key.---
> - hosts: all
>
> tasks:
> - debug:
> msg: "{% for host in groups['all'] %} {{
> hostvars[host]['ansible_facts']['ssh_host_key_ecdsa_public'] }} {% endfor %}"
>
>
> Hugo G.
>
>
>
>
>
> --
> 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/d10c2a5d-48dd-dd67-d85e-4cd3a29d819d%40redhat.com
>
> <https://groups.google.com/d/msgid/ansible-project/d10c2a5d-48dd-dd67-d85e-4cd3a29d819d%40redhat.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/5AF458C6-F964-4EE2-A61F-33F76510D6CE%40gmail.com.
For more options, visit https://groups.google.com/d/optout.