Ansible for XOS

  • 0
  • 4
  • Question
  • Updated 2 months ago
  • Answered
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 ?
Photo of Andreas Larsen

Andreas Larsen

  • 290 Points 250 badge 2x thumb

Posted 3 years ago

  • 0
  • 4
Photo of eyeV

eyeV

  • 2,484 Points 2k badge 2x thumb
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.
Photo of PARTHIBAN CHINNAYA

PARTHIBAN CHINNAYA, Alum

  • 4,362 Points 4k badge 2x thumb
I was told in 15.6 python shell is open
Photo of eyeV

eyeV

  • 2,484 Points 2k badge 2x thumb
Sorry, but do you get some information about it?
Photo of Grosjean, Stephane

Grosjean, Stephane, Employee

  • 12,226 Points 10k badge 2x thumb
Python 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).
Photo of eyeV

eyeV

  • 2,484 Points 2k badge 2x thumb
Thanks! I should upgrade my switches)
Photo of Holmberg, Mikael

Holmberg, Mikael, Employee

  • 140 Points 100 badge 2x thumb
Stay tuned, we are working on Ansible support in EXOS.
Photo of andreas

andreas

  • 1,218 Points 1k badge 2x thumb
Still no framework from extreme ?
Photo of Dave Hammers

Dave Hammers, Dir SW Engineering

  • 3,502 Points 3k badge 2x thumb

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"
  }


Photo of andreas

andreas

  • 1,218 Points 1k badge 2x thumb
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
Photo of andreas

andreas

  • 1,218 Points 1k badge 2x thumb
Any update here ?
Photo of andreas

andreas

  • 1,218 Points 1k badge 2x thumb
Any update ?
Photo of Grosjean, Stephane

Grosjean, Stephane, Employee

  • 12,562 Points 10k badge 2x thumb
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.
Photo of Richard Salts

Richard Salts

  • 60 Points
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.
Photo of Bruce Garlock

Bruce Garlock

  • 612 Points 500 badge 2x thumb
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.  
Photo of Grosjean, Stephane

Grosjean, Stephane, Employee

  • 12,562 Points 10k badge 2x thumb
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.
Photo of Tasos Vlachogiannis

Tasos Vlachogiannis

  • 156 Points 100 badge 2x thumb
Do you have any updates on that tool? 
Photo of Johannes Denninger

Johannes Denninger

  • 492 Points 250 badge 2x thumb
any news on that topic?
Photo of Bin

Bin, Employee

  • 5,350 Points 5k badge 2x thumb
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, 
Photo of M.Nees

M.Nees, Embassador

  • 9,156 Points 5k badge 2x thumb
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
Photo of Lindsay Hill

Lindsay Hill, Employee

  • 222 Points 100 badge 2x thumb
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.
Photo of Lindsay Hill

Lindsay Hill, Employee

  • 222 Points 100 badge 2x thumb
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