Re: [ansible-project] Re: eos_command module waitfor - IP address in json structure

2016-03-23 Thread Peter Sprygada
My pleasure, glad you found it helpful. On Wed, Mar 23, 2016 at 3:41 PM, Martin Baro 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

Re: [ansible-project] Re: eos_command module waitfor - IP address in json structure

2016-03-23 Thread Martin Baro
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.

Re: [ansible-project] Re: eos_command module waitfor - IP address in json structure

2016-03-22 Thread Peter Sprygada
(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" p

Re: [ansible-project] Re: eos_command module waitfor - IP address in json structure

2016-03-22 Thread Peter Sprygada
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 wrote: > Thats a bug... could you file an issue at > github.com/ansible/ansible-modules-core please

Re: [ansible-project] Re: eos_command module waitfor - IP address in json structure

2016-03-22 Thread Peter Sprygada
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 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 stateme

[ansible-project] Re: eos_command module waitfor - IP address in json structure

2016-03-22 Thread Martin Baro
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\'].hard

[ansible-project] Re: eos_command module waitfor - IP address in json structure

2016-03-22 Thread Uditha Desilva
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 sto

[ansible-project] Re: eos_command module waitfor - IP address in json structure

2016-03-21 Thread Martin Baro
Hi, It seems it`s not evaluating the routes[] part: with your waitfor: ValueError: result[0].vrfs.default.routes[1.2.3.4/30].hardwareProgrammed I also tried to index it with [0] without success: ValueError: result[0].vrfs.default.routes[0].hardwareProgrammed On Monday, March 21, 2016 at 6:0

[ansible-project] Re: eos_command module waitfor - IP address in json structure

2016-03-21 Thread Uditha Desilva
The dotted form is a shorthand for using braces, so maybe this will work: - "result[0].vrfs.default.routes['{{ route }}'].hardwareProgrammed eq true" On Monday, 21 March 2016 16:56:35 UTC, Martin Baro wrote: > > Hi > > I`m trying to catch a specific route in the waitfor statment if it is