It just worked like a charm.
Thank you so much. I really appreciate.

On Friday, 30 October 2020 at 16:10:49 UTC+5:30 [email protected] wrote:

> On 10/30/20 12:24 PM, Pravin V wrote:
> > Hello Everyone,
> > 
> > I have a playbook
> > - name: Test
> >   uri:
> >       url: https://192.168.1.1
> >       method: POST
> >       body:
> >         "IPADDRESS={{ item.address }}"
> >       body_format: "form-urlencoded"
> >   when: item.device_type.model == "2921" or
> >         item.device_type.model == "3931"
> > 
> > But this way list is going very big. 
> > Now I want to create some sort of dictionary and put the name of that to 
> use with when like below:
> > vars:
> >   - ciscorouters:
> >     - 2921
> >     - 3931 
> > 
> >   when: item.device_type.model == {{ ciscorouters }}
> > 
> > Please let me know the procedure.
>
> 1. You can't use {{ }} in when conditions. The condition is already 
> virtually wrapped in {{ }}
>
> 2. Try the following:
>
> when: item.device_type.model in ciscorouters
>
> Regards
> Racke
>
> > 
> > Thanks in advance.
> > 
> > -- 
> > 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] <mailto:
> [email protected]>.
> > To view this discussion on the web visit
> > 
> https://groups.google.com/d/msgid/ansible-project/ff66b4cc-0963-4ca3-a251-6c0e5a2c12c3n%40googlegroups.com
> > <
> https://groups.google.com/d/msgid/ansible-project/ff66b4cc-0963-4ca3-a251-6c0e5a2c12c3n%40googlegroups.com?utm_medium=email&utm_source=footer
> >.
>
>
> -- 
> Ecommerce and Linux consulting + Perl and web application programming.
> Debian and Sympa administration. Provisioning with Ansible.
>
>

-- 
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/400a9036-ea7e-4598-8c39-61e9cefb42cfn%40googlegroups.com.

Reply via email to