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].
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/d10c2a5d-48dd-dd67-d85e-4cd3a29d819d%40redhat.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to