Ansible for XOS

  • 2 February 2015
  • 23 replies
  • 795 views

Userlevel 1
Have anyone done any playbook work with ansible for Extreme networks ? Is there anything done in the ansible-galaxy part or anything done internally at Extreme ?

23 replies

Userlevel 3
Hello.
I use Ansible for servers configuration sometimes. But is it possible to use Ansible for XOS?

I know Ansible pushes a python script to node, but there is no python interpreter on the Extreme switches.

It would be great if someone corrected me.
Userlevel 4
I was told in 15.6 python shell is open
Userlevel 3
I was told in 15.6 python shell is openSorry, but do you get some information about it?
Userlevel 7
I was told in 15.6 python shell is openPython 2.7 is part of EXOS since 15.6. You can script and interact with EXOS (send EXOS cmd and capture the result, in text, xml or both), create sockets, and all the good thing Python can do with the standard library.

And there's more to come in the short term (15.7).
Userlevel 3
I was told in 15.6 python shell is openThanks! I should upgrade my switches)
I was told in 15.6 python shell is openStay tuned, we are working on Ansible support in EXOS.
Userlevel 2
Still no framework from extreme ?
Userlevel 5
Ansible is designed to run python modules on the managed device and return JSON results.

I have a question for the community about an Ansible implementation.

If there were an Ansible EXOS module that pushed EXOS CLI commands from a playbook to a switch, and the switch returned JSON data, would that work for the Ansible users?

Playbook example: (I may not have this just right)

hosts: exosswitches

vars:

portno: ""

tasks:

-name collect port statistics

exos: show ports {{ portno }} statistics no-refresh

The data returned from an EXOS device for portno=1 would look like:

[

{
"show_ports_stats": {
"dot1dTpPortInDiscards": 0,
"dot1dTpPortInFrames": 616,
"dot1dTpPortMaxInfo": 1500,
"dot1dTpPortOutFrames": 626,
"linkState": 1,
"port": 1,
"portList": 1,
"portNoSnmp": 1,
"rxBcast": 0,
"rxByteCnt": 110071,
"rxMcast": 305,
"rxPktCnt": 616,
"txBcast": 0,
"txByteCnt": 112932,
"txMcast": 303,
"txPktCnt": 626
},
"status": "SUCCESS"
}
Userlevel 2
Hi !
First of all thank you for sharing and asking.

From my perspective I would like to have the answer back in Json format. That would be very useful and easy to parse out.

// Andreas
Userlevel 2
Any update here ?
Userlevel 2
Any update ?
Userlevel 7
Hi,

With EXOS 21.1, there're several enhancements that open doors to Ansible. There's a MMI, using JSONRPC with different methods: CLI or Python. So that's, imho, the foundation for using Ansible here.

http://documentation.extremenetworks.com/app_notes/MMI/121152_MMI_Application_Release_Notes.pdf

However, there's no module nor playbook, and it may require some effort yet to have it running smoothly.
You can also use ansible modules from the managing host with delegate_to. I think many of the modules for setting up vms on aws, configure bigip loadbalancers and a few others.
Userlevel 2
Hello, came here looking for anyone using Ansible to push firmware updates to XOS devices, and it looks like it's still in process, and more of a 21.1 thing. Since the last post is seven months old, I'm wondering if any progress has been made on this. I would just like to easily push firmware updates to all our Summit switches, without having to login to each one and TFTP/SCP the XOS firmware and SSH mod.
Userlevel 7
Hi,

For the moment, there's no official support for Ansible.

Would you be interested in a separate "tool" that could manage your EXOS switches in a similar way, but not exactly like Ansible? The tool would NOT be an official extreme tool, but rather a home-made one. Testing not really done, this is really "home-made".

That tool would also require 21.1 or later.
Hi,

For the moment, there's no official support for Ansible.

Would you be interested in a separate "tool" that could manage your EXOS switches in a similar way, but not exactly like Ansible? The tool would NOT be an official extreme tool, but rather a home-made one. Testing not really done, this is really "home-made".

That tool would also require 21.1 or later.
Do you have any updates on that tool?
Userlevel 2
any news on that topic?
Userlevel 5
Hi,

Current EXOS is not support Ansible.

On another way, we offer JSONRPC which could collect the datat from an EXOS switch in machine readable JSON format.
https://github.com/extremenetworks/ExtremeScripting/tree/master/EXOS/Python/jsoncli

Best regards,
Userlevel 6
Are there some new steps for EXOS support regarding ansible ?

GitHub now present this topic - but without any content:
https://github.com/extremenetworks/ansible-extreme
Userlevel 2
Nothing new on EXOS (yet). We've just created that repo to have a place to put docs and example playbooks for using the new SLX modules that we're working on here https://github.com/StackStorm/ansible/tree/slxos_modules

I would love to also have EXOS modules in future, but nothing committed yet.

Of course, if others want to get started with writing Ansible modules, that would be great. They are all Open Source, and it's not that hard to get started with writing your own. See https://github.com/ansible/ansible/tree/devel/lib/ansible/modules/network for all the other examples.

Modules don't have to be written by the vendor themselves. Anyone can write them. You can see that a user has written modules for MLXe (Ironware). These are in the 2.5 release, which is in final RC stage right now, and will probably go GA next week.
Userlevel 2
SLX Ansible modules are now getting merged into Ansible core. See https://github.com/ansible/ansible/pull/38235 and https://github.com/ansible/ansible/pull/38607

Another user has started EXOS modules - the first one might get merged soon https://github.com/ansible/ansible/pull/37775
Userlevel 2
SLX Ansible modules are now getting merged into Ansible core. See https://github.com/ansible/ansible/pull/38235 and https://github.com/ansible/ansible/pull/38607

Another user has started EXOS modules - the first one might get merged soon https://github.com/ansible/ansible/pull/37775
FYI: exos_command and SLX-related modules are in Ansible 2.6, which has just been released as GA.
Userlevel 2
exos_facts has been merged into Ansible 2.7-dev0. You can use this by running the 'devel' version of Ansible. See https://github.com/ansible/ansible/pull/43210

exos_config has been submitted to Ansible. https://github.com/ansible/ansible/pull/43902 This should also make it into Ansible 2.7 GA, but you can of course use it now.

Reply