I played around some more and was able to figure it out. thanks for
teaching me how to fish.

On Wed, Jan 22, 2020 at 4:35 PM Mike V <[email protected]> wrote:

> Works great!  I never used templates, just a little bit more help, how do
> I export the host variables and group variables too?
> Thank you!
>
> On Wed, Jan 22, 2020 at 4:20 PM Vladimir Botka <[email protected]> wrote:
>
>> 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/CAMRjU07%3DxYw0bnrq9OHOh75WUVXUZHx8d%3DCuOb4TYpGns67Hwg%40mail.gmail.com.

Reply via email to