title: How to loop over my inventory list in jinja2 (currently using a template in my playbook)
body: <p>I'm attempting to get the output of some show commands on some network devices. My current code loops over the same host 4 times instead of over all 4 hosts in my inventory file. How do I rectify this ?</p>
  
  <p>Using Ubuntu 16.04 server, Ansible 2.7</p>
  
  <pre><code>My Jinja template:
  {% for host in groups.ios_devices %}
   {% if not host==inventory_hostname %}
  .......
  hostname: {{device_info.ansible_facts['ansible_net_hostname']}}
  Interfaces: {{int_status}}
  .......
   {% endif %}
  {% endfor %}
  ## ios_devices is my host inventory file with all ip-addresses##
  
  Playbook:
  ----------
   template:
         src: ./template/temp.j2
         dest: report.txt
  </code></pre>
  
  <p>I expected this to run across all my inventory host ip's , but see that the output has loops over the same ip.</p>