Thanks very much.

Basically what I want is , I have a file to store my variable, it has the 
following contents

value1: Something1
value2: Something2

privs1: privs_value1
privs2: privs_value2

In my playbook, I want to iterate this 

value: "{{value1}}"
privilege: "{{privs1}}"

value: "{{value2}}"
privilege: "{{privs2}}"



On Monday, February 3, 2020 at 11:36:40 PM UTC-5, Vladimir Botka wrote:
>
> On Mon, 3 Feb 2020 16:31:21 -0800 (PST) 
> Anand Solomon <[email protected] <javascript:>> 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/443e0ea1-80f5-44be-b01d-198f1f6208e3%40googlegroups.com.

Reply via email to