If you have to generate exactly one file, you can try creating a dynamic 
inventory

Florent B <[email protected]> napisał:
>Hi,
>
>I would like to write a complex variable (list) for each host in my 
>inventory file.
>I know it's not a best practice, but I cannot write a vars file per
>host (constrained 
>by project).
>
>So I tried something like this :
>
>[my-hosts]
>192.168.0.161 
>pub=[{ip:'192.168.0.162',proto:'tcp'},{ip:'192.168.0.163',proto:'tcp'}]
>
>But it does not seem to work, I cannot use it in with_indexed_items for
>
>example. Variable seems to be treated as a string.
>It returns "with_indexed_items expects a list".
>
>How can I do ?
>
>I use Ansible 1.8.4
>
>Thank you a lot.
>
>-- 
>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/e23b6d60-acbb-4905-bee1-dd36204adde2%40googlegroups.com.
>For more options, visit https://groups.google.com/d/optout.

-- 
Wysłane za pomocą K-9 Mail.

-- 
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/52b3d3e0-4c59-43bc-b3a6-c6f7f8b6a651%40email.android.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to