name: Ak BGP Neighbor check
ignore_errors: yes
ios_command:
commands:
sh ip bgp neighbors xxx.xxx.xxx.x advertised-routes
provider: "{{ cli }}"
register: AkCheck
when running on the router it runs properly but gives error when using ansible .
output is as follow:
task path: /tmp/testing/networking/roles/prevalidations/tasks/main.yml:26
fatal: []: FAILED! => {
"changed": false,
"failed": true,
"invocation": {
"module_args": {
"auth_pass": null,
"authorize": null,
"commands": [
"sh ip bgp neighbors xxx.xxx.xxx.xxx advertised-routes"
],
"host": null,
"interval": 1,
"match": "all",
"password": null,
"port": null,
"provider": {
"auth_pass": null,
"authorize": true,
"host": "***",
"password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
"port": null,
"ssh_keyfile": null,
"timeout": null,
"transport": "cli",
"username": "fc.abc"
},
"retries": 10,
"ssh_keyfile": null,
"timeout": null,
"username": null,
"wait_for": null
}
},
"msg": "ditional-path, c RIB-compressed, \r\nOrigin codes: i - IGP, e - EGP, ? - incomplete\r\nRPKI validation codes: V valid, I invalid, N Not found\r\n\r\n Network Next Hop Metric LocPrf Weight Path\r\n *> xxx.xxx.xxx.x 0.0.0.0 ",
"rc": 1
}
...ignoring
Tuesday 25 July 2017 07:34:56 +0000 (0:00:03.013) 0:00:03.109
TASK [prevalidations : debug] **
task path: /tmp/vibhav_testing/networking/roles/prevalidations/tasks/main.yml:34
fatal: []: FAILED! => {
"failed": true,
"msg": "the field 'args' has an invalid value, which appears to include a variable that is undefined. The error was: 'dict object' has no attribute 'stdout'\n\nThe error appears to have been in '/tmp/vibhav_testing/networking/roles/prevalidations/tasks/main.yml': line 34, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- debug:\n ^ here\n"
}
here the output comes similar to one run on hostmachine but incomplete and cisco returns rc=1 .
i am trying to run a simple ios_command :+1:
when running on the router it runs properly but gives error when using ansible . output is as follow: task path: /tmp/testing/networking/roles/prevalidations/tasks/main.yml:26 fatal: []: FAILED! => { "changed": false, "failed": true, "invocation": { "module_args": { "auth_pass": null, "authorize": null, "commands": [ "sh ip bgp neighbors xxx.xxx.xxx.xxx advertised-routes" ], "host": null, "interval": 1, "match": "all", "password": null, "port": null, "provider": { "auth_pass": null, "authorize": true, "host": "***", "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", "port": null, "ssh_keyfile": null, "timeout": null, "transport": "cli", "username": "fc.abc" }, "retries": 10, "ssh_keyfile": null, "timeout": null, "username": null, "wait_for": null } }, "msg": "ditional-path, c RIB-compressed, \r\nOrigin codes: i - IGP, e - EGP, ? - incomplete\r\nRPKI validation codes: V valid, I invalid, N Not found\r\n\r\n Network Next Hop Metric LocPrf Weight Path\r\n *> xxx.xxx.xxx.x 0.0.0.0 ", "rc": 1 } ...ignoring Tuesday 25 July 2017 07:34:56 +0000 (0:00:03.013) 0:00:03.109
TASK [prevalidations : debug] ** task path: /tmp/vibhav_testing/networking/roles/prevalidations/tasks/main.yml:34 fatal: []: FAILED! => { "failed": true, "msg": "the field 'args' has an invalid value, which appears to include a variable that is undefined. The error was: 'dict object' has no attribute 'stdout'\n\nThe error appears to have been in '/tmp/vibhav_testing/networking/roles/prevalidations/tasks/main.yml': line 34, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- debug:\n ^ here\n" }
here the output comes similar to one run on hostmachine but incomplete and cisco returns rc=1 .
please help .