Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arubaoss_command cannot catch exceptions (for example if switch is down) #31

Open
okin8 opened this issue Mar 17, 2022 · 2 comments
Open

Comments

@okin8
Copy link

okin8 commented Mar 17, 2022

if switch is not reachable it is still reported as OK. In this simplest example I have a non-existing switch with 1.1.1.1 in inventory.

Ansible reports as task was executed OK.

sa@m1 ansible % ansible-playbook -i inv-aruba.ini pb-aruba.yml

PLAY [all] **************************************************************************************

TASK [Execute show run on the switch] ***********************************************************
ok: [Aruba2930-LAB]

PLAY RECAP **************************************************************************************
Aruba2930-LAB              : ok=1    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   

sa@m1 ansible %  cat inv-aruba.ini 
[lab]
Aruba2930-LAB ansible_host=1.1.1.1 ansible_user=manager ansible_password=password12 ansible_network_os=arubanetworks.aos_switch.arubaoss ansible_connection=network_cli
sa@m1 ansible % cat pb-aruba.yml 
---
# SSH CLI Access - 
# https://galaxy.ansible.com/arubanetworks/aos_switch
- hosts: all
  gather_facts: false
  collections:
    - arubanetworks.aos_switch
  vars:
    ansible_connection: network_cli
    ansible_network_os: arubanetworks.aos_switch.arubaoss

  tasks:
    - name: Execute show run on the switch
      arubaoss_command:
        commands: ['show run']
sa@m1 ansible % 
@tchiapuziowong
Copy link
Member

We're utilizing Ansible's netcommon library to build our SSH connection - this appears to be an issue with that dependency which restricts our ability to resolve this within Aruba's code - we're still investigating this internally and we've included this as a dependent issue in Ansible's open issue for the same behavior here:
ansible-collections/ansible.netcommon#340

@okin8
Copy link
Author

okin8 commented Mar 23, 2022

why I don't similar issues with Cisco collection? Both are using same network_cli

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants