Hi,

I want to gather all the NICs and its IP address from facts. So I tried
iterating to all interfaces, i.e

{% for nic in ansible_interfaces %}
  {% set present_nic = 'facter_ipaddress_%s' | format( nic ) %}
| {{ nic }} | {{ present_nic }} |
{% endfor %}

The present_nic variable turn into some form of string and won't evaluate
object anymore. :(

I wanted to grab the value of 'facter_ipaddress_{{ nic }} key, but instead
got a literal string.

| *NIC* | *IP* | *Netmask* |
  | lo | facter_ipaddress_lo |
  | enp0s3 | facter_ipaddress_enp0s3 |
  | enp0s8 | facter_ipaddress_enp0s8 |

Is there a way to get around with this, without resorting to writing a
custom facts/module?

TIA,
Lupin

-- 
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/CAL0mBkTSG6V5HUG8kSq1G2muOaKaH6cSMfTnc_kYOkEYGNE6Fg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to