Hi

I`m trying to catch a specific route in the waitfor statment if it is 
present from a show ip route output.
However I think ansible misinterprets the statement because of the dots in 
the IP address.
(I can successfully test other values like vrfs.default.defaultRouteState )
The playbook:
---

- name: test playbook
  hosts: veos
  gather_facts: no
  connection: local
  vars:
   route: "1.2.3.4/30"
  tasks:
   - name: show ip route
     eos_command:
      commands:
       - show ip route | json
      username: ansible
      password: ansible
      host: x.x.x.x
      transport: cli
      waitfor:
       - "result[0].vrfs.default.routes.{{ route }}.hardwareProgrammed eq 
true"

The error was: ValueError: 
result[0].vrfs.default.routes.1.2.3.4/30.hardwareProgrammed

The json structure is:
"vrfs": {
                    "default": {
                        "allRoutesProgrammedHardware": true,
                        "allRoutesProgrammedKernel": true,
                        "defaultRouteState": "notSet",
                        "routes": {
                            "1.2.3.4/30": {
                                "directlyConnected": true,
                                "hardwareProgrammed": true,
                                "kernelProgrammed": true,
                                "routeAction": "forward",
                                "routeType": "connected",
                                "vias": [
                                    {
                                        "interface": "Ethernet2"
                                    }
                                ]
                            },
                            "192.168.48.0/24": {
                                "directlyConnected": true,
                                "hardwareProgrammed": true,
                                "kernelProgrammed": true,
                                "routeAction": "forward",
                                "routeType": "connected",
                                "vias": [
                                    {
                                        "interface": "Ethernet1"
                                    }
                                ]
                            }

Is there any way I can reference the specific route?

Thanks,

Martin


-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/f64d1b4d-fa39-4949-b7ca-0a93c7b8b783%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to