On Mon, 3 Feb 2020 16:31:21 -0800 (PST) Anand Solomon <[email protected]> wrote:
> variablefile.yml
>
> var1:
> - first_value1
> - first_value2
> var2:
> - second_value1
> - second_value2
> var3:
> - third_value1
> - third_value2
>
> I want to read the value from the text file and pass that as a variable in
> loop.
The tasks below
- include_vars: variablefile.yml
- debug:
var: item
loop: "{{ var1 + var2 + var3 }}"
give
"item": "first_value1"
"item": "first_value2"
"item": "second_value1"
"item": "second_value2"
"item": "third_value1"
"item": "third_value2"
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/20200204053624.21bdfc94%40gmail.com.
pgpDJQg2AhuAz.pgp
Description: OpenPGP digital signature
