aruba / aruba-ansible-modules

Aruba Ansible Modules
Apache License 2.0
80 stars 36 forks source link

Can't save config with aruba_config module #85

Closed zenchaos closed 4 years ago

zenchaos commented 4 years ago

Steps fail on the on the 2920 or 2930F switches using the aruba_config module if save is set to always. The failure states that the command is "copy running-config startup-config". That is not a valid command on either of those switch models. The only command that I know of which will save the config on all models of switches both wired and wireless is "write memory".

The only workaround has been to run a later step using aruba_command to "wr mem".

tchiapuziowong commented 4 years ago

Hi @zenchaos ! The aruba_config command is a module originally written by RedHat for the Mobility Master controller, so it's functionality isn't supported with AOS-Switch devices. There are ways to use the module with devices for SSH/CLI commands but the behavior can be unpredictable at times. We're currently developing an implementation of these modules for AOS-Switch and that will be available next month!

zenchaos commented 4 years ago

It's been a very useful module for us. Since it uses ssh, we can use it to enable the features necessary for the rest interface on switches that are already out in the field. It has also been more reliable for us than the modules using the rest API. I often start receiving the following error.

TASK [arubaoss_ntp : configure timesync to be ntp] **** fatal: [switch2920]: 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"}

With no changes to the inventory file. When I use debug to output the content of the ansible_host variable, the correct address is displayed but the module doesn't run. Later, the problem will magically go away.

Since the aruba modules don't use Ansible facts, I have been using this command to do a "getMIB sysDescr.0" to determine switch model or "sh interfaces br A1" to see if a module is installed in the switch. This way we can assign the correct vlans to ports using the arubaoss_vlan module. If we try to use that module on ports that don't exist, the playbook fails out.

Currently, the play books do something like:

when: sysDescr is search("2920") and not ShInt is search("Module not present")

Is there a different method that should be implemented for this purpose?

The rest modules definitely run faster than the ssh ones but the ssh modules are still VERY useful at times.

tchiapuziowong commented 4 years ago

That's great that it's working for you! It's just these cases where things might seem like a 'bug', are actually caveats for the module not being properly implemented for these platforms.

Unfortunately the 2920 platform does not have the REST API support for configuring NTP. I've documented this limitation in the module_documentation/ for this module 👍 7838b7f

I went ahead and responded to the issue #81

zenchaos commented 4 years ago

Is there a way to know which modules will and won't work with 2920 switches? We have a large number of these so we can't use the arubaoss_ modules that don't support that model.

Is there a way to determine the hardware compatibility when running a module since facts can't be used?

tchiapuziowong commented 4 years ago

At this time we don't have a support matrix for platforms but what I would suggest is to download the REST API schema for the WB firmware found here: https://h10145.www1.hpe.com/downloads/DownloadSoftware.aspx?SoftwareReleaseUId=27125&ProductNumber=J9726A&lang=&cc=&prodSeriesId=&SaidNumber=

You can also see how to navigate through the REST API documentation using this post from our Airheads community: https://community.arubanetworks.com/t5/Developer-Community/Where-is-the-REST-documentation-for-the-AOS-Switch/m-p/455341

I hope this helps!

tchiapuziowong commented 4 years ago

As an update, we just published modules with SSH/CLI command support for the AOS-Switch platform! So if you're able to use SSH though I would suggest using our SSH modules arubaoss_command and arubaoss_config. To install these latest modules follow these steps. If you want to use a combination of both using REST API modules and SSH, I suggest reading this blurb about using both REST API and SSH/CLI modules.