Developer

 View Only
last person joined: 7 days ago 

Expand all | Collapse all

arubanetworks.aos_switch Collection issues

This thread has been viewed 24 times
  • 1.  arubanetworks.aos_switch Collection issues

    Posted Aug 19, 2022 10:49 AM
    Hi there,

    I'm having problems to use the arubaoss_facts module on a Aruba J9778A 2530-48-PoEP (YA.16.10.0022) switch but it simply doesn't work.

    I'm new on Ansible and have been trying to use basic modules and plays to gain experience.

    This is the standalone play that I'm using is:

    ansible all -i <IP ADDRESS>, -c ansible.netcommon.httpapi -u <user> -k -m arubanetworks.aos_switch.arubaoss_facts -e ansible_network_os=arubanetworks.aos_switch.arubaoss
    
    <IP ADDRESS> | FAILED! => {
    "msg": "unable to load API plugin for platform type arubanetworks.aos_switch.arubaoss"
    }​

    I'm also getting errors when using another connection protocols:

    ansible all -i <IP ADDRESS>, -c ansible.netcommon.netconf -u <user> -k -m arubanetworks.aos_switch.arubaoss_facts -e ansible_network_os=arubanetworks.aos_switch.arubaoss
    
    <IP ADDRESS> | FAILED! => {
    "changed": false,
    "msg": "Request failed: <urlopen error [Errno -3] Temporary failure in name resolution>",
    "status": -1,
    "url": "http://None:80/rest/v6.0/login-sessions"
    }​

    ansible all -i <IP ADDRESS>, -c ansible.netcommon.network_cli -u <user> -k -m arubanetworks.aos_switch.arubaoss_facts -e ansible_network_os=arubanetworks.aos_switch.arubaoss
    
    [WARNING]: ansible-pylibssh not installed, falling back to paramiko
    <IP ADDRESS> | FAILED! => {
    "changed": false,
    "msg": "Request failed: <urlopen error [Errno -3] Temporary failure in name resolution>",
    "status": -1,
    "url": "http://None:80/rest/v6.0/login-sessions"
    }​

    ansible all -i <IP ADDRESS>, -c local -u <user> -k -m arubanetworks.aos_switch.arubaoss_facts -e ansible_network_os=arubanetworks.aos_switch.arubaoss
    
    <IP ADDRESS> | FAILED! => {
    "ansible_facts": {
    "discovered_interpreter_python": "/usr/bin/python3"
    },
    "changed": false,
    "msg": "Request failed: <urlopen error timed out>",
    "status": -1,
    "url": "http://10.1.4.2:80/rest/v6.0/login-sessions"
    }
    ​

    I have added NETWORK_GROUP_MODULES=arubaoss to the ansible.cfg file and also confirmed that the switch has web-management ssl and rest-interface enabled.

    What am I missing here?


  • 2.  RE: arubanetworks.aos_switch Collection issues

    MVP GURU
    Posted Aug 24, 2022 07:03 AM
    What your playbook file and inventory file ?

    Missing i think, use_ssl settings (from last test, you are using http and not HTTPS)

    ------------------------------
    PowerArubaSW : Powershell Module to use Aruba Switch API for Vlan, VlanPorts, LACP, LLDP...

    PowerArubaCP: Powershell Module to use ClearPass API (create NAD, Guest...)

    PowerArubaCL: Powershell Module to use Aruba Central

    PowerArubaCX: Powershell Module to use ArubaCX API (get interface/vlan/ports info)..

    ACEP / ACMX #107 / ACDX #1281
    ------------------------------



  • 3.  RE: arubanetworks.aos_switch Collection issues

    Posted Aug 25, 2022 09:26 PM
    Hi there,

    I'm not using any playbooks, just trying to issue the command. I'm also not using a inventory file since I'm testing the command against a single switch.



  • 4.  RE: arubanetworks.aos_switch Collection issues

    Posted Aug 25, 2022 05:27 PM
    • If you use RADIUS or TACACS for switch management add also this command to the switch :
      switch(config)# aaa authentication rest login radius local
      switch(config)# aaa authentication rest enable radius local


    Also can you run in verbose mode by adding `-v` to the end of the command?


  • 5.  RE: arubanetworks.aos_switch Collection issues

    Posted Aug 25, 2022 09:27 PM
    Hi there,

    I'm using a local account, no RADIUS or TACACS is being used for management.


  • 6.  RE: arubanetworks.aos_switch Collection issues

    Posted Aug 30, 2022 03:31 PM
    I ran the following command on a 2540 and it executed successfully, is your env using a proxy variable when it shouldn't? also just to verify you have an `ansible.cfg` file in the same directory you're executing the command from?

    (py3_ansible) ansible-control-machine$ansible all -i 10.100.107.168, -c local -u admin -k -m arubanetworks.aos_switch.arubaoss_facts -e ansible_network_os=arubanetworks.aos_switch.arubaoss
    SSH password:
    10.100.107.168 | SUCCESS => {
        "ansible_facts": {
            "ansible_net_gather_network_resources": [],
            "ansible_net_gather_subset": [
                "default",
                "host_system_info",
                "switch_specific_system_info",
                "module_info",
                "system_power_supply"
            ],
            "ansible_net_host_system_info": {
                "base_ethernet_address": {
                    "octets": "b05ada-9622c0",
                    "version": "MAV_EUI_48"
                },
                "firmware_version": "YC.16.11.0006",
                "hardware_revision": "JL356A",
                "name": "Aruba-2540-24G-PoEP-4SFPP",
                "product_model": "Aruba2540-24G-PoE+-4SFP+ Switch(JL356A)",
                "serial_number": "CN6ZHKW060",
                "sys_fan_status": false,
                "total_memory_in_bytes": 358978048,
                "total_poe_consumption": 0,
                "uri": "/system/status"
            },
    ​

    Here is my ansible env information:
    (py3_ansible) ansible-control-machine$ansible --version
    ansible [core 2.12.1]
      config file = /ws/chiapuzi/tme/sandbox/aoss_playbooks/aoss_example_playbooks/ansible.cfg
      configured module search path = ['/users/chiapuzi/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
      ansible python module location = /ws/chiapuzi/tme/sandbox/py3_ansible/lib/python3.8/site-packages/ansible
      ansible collection location = /users/chiapuzi/.ansible/collections:/usr/share/ansible/collections
      executable location = /ws/chiapuzi/tme/sandbox/py3_ansible/bin/ansible
      python version = 3.8.9 (default, Apr  3 2021, 01:02:10) [GCC 5.4.0 20160609]
      jinja version = 3.0.1
      libyaml = True
    ​