I'm running a playbook with a single task on a Nokia router. The task contains a list of "show" commands - see the simplified example below:
---
- name: Nokia router checks for post power on
hosts: nokia_router_1
serial: 1
connection: network_cli
tasks:
- name: Post power on show command list
cli_command:
command:
- show time
- show version
- show router bgp summary
register: show
ignore_errors: true
- debug:
msg: {{show.stdout}}
For this particular router bgp is not configured so the show router bgp summary command returns
A:nokia_router_1# show router bgp summary MINOR: CLI BGP is not configured.
and does not show either of the previous show commands. If run against a router with bgp configured all 3 show command outputs are shown.
How can I stop ansible from failing the task when it sees the MINOR: error? What I really need is for Ansible to see the output simply as information and not be concerned about the content of the output I have ignore_errors: true but that will only apply to any additional tasks. I've also tried adding failed_when: with various conditions and using block, rescue and always, but with no success. I should add that I am using Ansible via an in-house gui but I have run the playbook using Ansible CLI with the same result.