Developer

last person joined: 7 days ago 

Expand all | Collapse all

aaa authentication port-access / mac-based with CLI Ansible modules

This thread has been viewed 4 times
  • 1.  aaa authentication port-access / mac-based with CLI Ansible modules

    Posted Sep 15, 2019 07:21 AM

    Hi,

     

    There are commands like

     

    aaa authentication port-access eap-radius authorized
    aaa authentication mac-based chap-radius authorized

     

    Which require to answer Yes/No after the command:

     

    The RADIUS connection timeout must be less than the
    authentication server timeout for the switch to authenticate
    automatically when the RADIUS server is unavailable.
    Do you want to continue? [y/n]

     

    Is it possible somehow to make it working with any of available CLI module?

    If not, it would be very very kind if one could create a module for the aaa port-access stuff.

     

    Thanks in advance.



  • 2.  RE: aaa authentication port-access / mac-based with CLI Ansible modules

    MVP GURU
    Posted Sep 15, 2019 01:15 PM

    Hi Michaely

     

    After a quick check, i don't found a API call for configure this parameter :(

     

    https://h10145.www1.hpe.com/downloads/DownloadSoftware.aspx?SoftwareReleaseUId=26402&ProductNumber=JL557A&lang=&cc=&prodSeriesId=&SaidNumber=

     



  • 3.  RE: aaa authentication port-access / mac-based with CLI Ansible modules

    Posted Sep 16, 2019 03:01 AM

    Thanks Alexis.

     

    Lets think about some creative solution :) that could fix that with cli module.

    I'm pretty sure we could send Y,/n somehow.



  • 4.  RE: aaa authentication port-access / mac-based with CLI Ansible modules

    MVP GURU
    Posted Sep 16, 2019 03:33 AM

    with API AnyCLI (or BatchCLI) no because interactive command is not supported...

     

    Need to have a ssh session to the switch..



  • 5.  RE: aaa authentication port-access / mac-based with CLI Ansible modules

    Posted Sep 16, 2019 03:36 AM

    What about that one?

     

    https://github.com/aruba/aruba-switch-ansible/tree/master/library

     

    https://community.arubanetworks.com/t5/Developer-Community/How-to-install-use-CLI-modules-and-tasks-for-Switch-and-CX-in/td-p/534333

     

    4. For ArubaOS-Switch and ArubaOS-CX, you can use the SSH CLI modules in the library/ directory to execute CLI commands as well as show commands. Remember this is using SSH to connect to your device, which means it may take more time to execute the command. Here are some examples below of how to use these modules for configuration and show commands. Keep in mind that in some of the examples I am passing Variables, but you're able to put information directly into the modules:

     

    Example for Switch:

     

    - name: Enable Interface 5
      arubaos_switch_ssh_cli:
        ip: "{{ansible_host}}"
        user: "{{ansible_user}}"
        password: "{{ansible_password}}"
        command_list: ["conf", "interface 5", "enable"]
    
    - name: Get output of show vlans
    arubaos_switch_ssh_cli:
    ip: "{{ansible_host}}"
    user: "{{ansible_user}}"
    password: "{{ansible_password}}"
    show_command: ["show vlans"]
    register: ssh_output

     

    Or that is part of the anycli?



  • 6.  RE: aaa authentication port-access / mac-based with CLI Ansible modules

    MVP GURU
    Posted Sep 16, 2019 03:47 AM

    Yes, it will be work...

     

    After a another check, there is a API call for mac-based (but not (yet) found for port-access

     

    (Sorry using Powershell)

    (Invoke-ArubaSWWebRequest -uri "rest/v7/authentication/mac_based").content | ConvertFrom-Json
    
    uri                       auth_mac_based
    ---                       --------------
    /authentication/mac_based @{primary_method=PAM_CHAP_RADIUS; secondary_method=SAM_AUTHORIZED; server_group=}


  • 7.  RE: aaa authentication port-access / mac-based with CLI Ansible modules
    Best Answer

    Posted Sep 16, 2019 04:05 AM

    'aaa authentication port-access eap-radius authorized',
    'y',

     

    That one worked great.

     

    Nice