On Wed, 13 Jan 2021 17:39:31 -0800 (PST)
"'Aristotle D Aguirre' via Ansible Project"
<[email protected]> wrote:

> ... template
> {% for host in groups.all  %}
>      {{  hostvars[host]['ansible_all_ipv4_addresses'], 
> hostvars[host]['ansible_fqdn'],hostvars[host]['inventory_hostname_short'] }}
> {% endfor %}
> 
> ... result
>      ([u'192.10.100.1'], u'server01.example.com', u' u'server01')
>      ([u'192.10.100.2'], u'server02.example.com', u' u'server02')
> 
> ... expected
> 192.10.100.1 server01.example.com server01
> 192.10.100.2 server02.example.com server02

Fix the template
https://gist.github.com/vbotka/31cdd229878a72780a72ea412252ab95

* Expand the items one by one
* Take the first item of *ansible_all_ipv4_addresses* (if this is what
  you want)


-- 
Vladimir Botka

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/20210114045253.21804793%40gmail.com.

Attachment: pgpwupp5FytHU.pgp
Description: OpenPGP digital signature

Reply via email to