My pleasure, glad you found it helpful.

On Wed, Mar 23, 2016 at 3:41 PM, Martin Baro <[email protected]>
wrote:

> Thanks Peter, much appreciated.
> Also thanks for the great network webinar, was really informative.
>
> Martin
>
> On Wednesday, March 23, 2016 at 7:40:56 AM UTC+1, Peter Sprygada wrote:
>>
>> (ansible)[ansible-eos]$ cat route.yaml
>> ---
>> - hosts: veos01
>>   gather_facts: no
>>
>>   vars:
>>     route: 1.1.1.1/32
>>
>>   tasks:
>>     - eos_command:
>>         commands:
>>           - show ip route | json
>>         waitfor:
>>           - "result[0].vrfs.default.routes[{{ route
>> }}].hardwareProgrammed eq true"
>>         provider: "{{ cli }}"
>>
>>
>> (ansible)[ansible-eos]$ ansible-playbook route.yaml
>>
>> PLAY [veos01]
>> ******************************************************************
>>
>> TASK [eos_command]
>> *************************************************************
>> ok: [veos01]
>>
>> PLAY RECAP
>> *********************************************************************
>> veos01                     : ok=1    changed=0    unreachable=0
>>  failed=0
>>
>> On Wed, Mar 23, 2016 at 2:39 AM, Peter Sprygada <[email protected]>
>> wrote:
>>
>>> Ignore the request for filing an issue, I committed a change that should
>>> fix this problem. The fix is available for testing in ansible/ansible devel
>>>
>>> On Tue, Mar 22, 2016 at 4:25 PM, Peter Sprygada <[email protected]>
>>> wrote:
>>>
>>>> Thats a bug... could you file an issue at
>>>> github.com/ansible/ansible-modules-core please?
>>>>
>>>> On Tue, Mar 22, 2016 at 2:17 PM, Martin Baro <[email protected]>
>>>> wrote:
>>>>
>>>>> Hi Uditha,
>>>>>
>>>>> Thanks for the reply.
>>>>> I've simplified the problem a bit (just removed the variable) and with
>>>>> removing the "" around the whole statement I managed to preserve the 
>>>>> quotes.
>>>>> Unfortunately it didn't solve the problem:
>>>>>
>>>>>     waitfor:
>>>>>        - result[0].vrfs.default.routes[\'
>>>>> 1.2.3.4/30\'].hardwareProgrammed
>>>>> <http://1.2.3.4/30%5C'%5D.hardwareProgrammed> eq true
>>>>>
>>>>> The error was: ValueError: result[0].vrfs.default.routes['
>>>>> 1.2.3.4/30'].hardwareProgrammed
>>>>> <http://1.2.3.4/30'%5D.hardwareProgrammed>
>>>>>
>>>>> The issue is the same with double quotes around the IP address.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Tuesday, March 22, 2016 at 2:50:05 PM UTC+1, Uditha Desilva wrote:
>>>>>>
>>>>>> It may need more protection for those quotes -- perhaps this?
>>>>>>
>>>>>>        - "result[0].vrfs.default.routes[\'{{ route 
>>>>>> }}\'].hardwareProgrammed
>>>>>> eq true"
>>>>>>
>>>>>>>
>>>>>>>>> --
>>>>> 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/7f5a3e93-84cc-43c7-b11f-50ccb849971a%40googlegroups.com
>>>>> <https://groups.google.com/d/msgid/ansible-project/7f5a3e93-84cc-43c7-b11f-50ccb849971a%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>
>>>>
>>>
>> --
> 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/b0ae52f7-b3a7-4f4d-820a-4389a4921e1b%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/b0ae52f7-b3a7-4f4d-820a-4389a4921e1b%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAEkdrMg-2gOc_oQbMkSiUrW-hUq5JJqYzmmX%2BDjwC0ua_SLz5w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to