On Tue, 21 Jul 2020 at 16:08, nicolas stevenin <[email protected]>
wrote:

> Hi,
>
> I have a file like : [1,2,3,4,5]
>


'Like' is ambiguous. What is like what?
Is the filename like 12345? Is the content a json list of integers? Please
try to be precise.


and I want to use loop for each number in this file on the playbook (I want
> to use the file, not write keys in the playbook).
>


No idea again what 'writing keys in the playbook' means. So again please be
precise.


Could you help me please ?
>
> The playbook:  (and i need to loop on "variable_file")
>     - name: Gather info about all ESXi Host in given Cluster
>       vmware_host_service_info:
>         validate_certs: no
>         hostname: xxxxx
>         username: user
>         password: password
>         cluster_name: "{{variable_file}}"
>
>

A wild guess, if you want to read the contents of a file ? Maybe this is
what you want:

https://docs.ansible.com/ansible/latest/plugins/lookup/lines.html





> Thanks for your help
>
> --
> 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/c4322a92-5792-48e6-9973-59cdfd03b9e7o%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/c4322a92-5792-48e6-9973-59cdfd03b9e7o%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
-- 
Sent from a mobile device - please excuse the brevity, spelling and
punctuation.

-- 
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/CAL8fbwPzNnPKi-jd0bMqVX_NFYDwDa6NWW4qyOw%2BTG%2BbkDUW8Q%40mail.gmail.com.

Reply via email to