On Wed, 22 Jan 2020 16:10:42 -0800
Mike V <[email protected]> wrote:

> I have a playbook that generates in-memory inventory.  The hosts are part
> of multiple groups.  Is there a module or easy way to export the in-memory
> inventory to an output file?

Yes. It is. For example use this template

  {% for group in groups %}
  [{{ group }}]
  {% for host in groups[group] %}
  {{ host }}
  {% endfor %}
  
  {% endfor %}

HTH,

        -vlado

-- 
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/20200123012048.5e735958%40gmail.com.

Attachment: pgpYrhMy05s7A.pgp
Description: OpenPGP digital signature

Reply via email to