JNPRAutomate / ansible-junos-evpn-vxlan

Sample project that use Ansible and Jinja2 template to automatically generate configurations for Juniper devices deploy in EVPN/VXLAN fabric mode
MIT License
91 stars 64 forks source link

add channelized interface support #34

Open ksator opened 7 years ago

ksator commented 7 years ago

Hello This is a corner case and this is not related to evpn-vxlan so feel free to push back this issue: if we want to use channelized interface support (xe-0/0/3:1 as example) (as example on qfx10002 if the fabric switch has only 10 Gbps ports) it currently breaks the yaml structure in the sample.topology.yml. Example, this doesnt work:

 spine-02:
    port1: { name: et-0/0/13,    peer: leaf-01,      pport: port2,     type: ebgp, link: 3,   linkend: 1 }
    port2: { name: et-0/0/12,    peer: leaf-02,      pport: port2,     type: ebgp, link: 4,   linkend: 1 }
    port3: { name: xe-0/0/3:1,    peer: fabric-01,    pport: port2,     type: ebgp, link: 7,   linkend: 1 }
    port4: { name: xe-0/0/2:0,    peer: fabric-02,    pport: port2,     type: ebgp, link: 8,   linkend: 1 }

we just need to add quotes to fix the issue (to make the interface name a string, so the colom doesnt break the yaml structure). This is working:

 spine-02:
    port1: { name: et-0/0/13,    peer: leaf-01,      pport: port2,     type: ebgp, link: 3,   linkend: 1 }
    port2: { name: et-0/0/12,    peer: leaf-02,      pport: port2,     type: ebgp, link: 4,   linkend: 1 }
    port3: { name: "xe-0/0/3:1",    peer: fabric-01,    pport: port2,     type: ebgp, link: 7,   linkend: 1 }
    port4: { name: "xe-0/0/2:0",    peer: fabric-02,    pport: port2,     type: ebgp, link: 8,   linkend: 1 }

But we need to re-channelized the channelized interface because ansible will overwrite running configuration ("set chassis fpc 0 pic 0 port 0 channel-speed 10g" as example)

dgarros commented 7 years ago

Hi @ksator.

Both examples looks the same to me :) Also, both ways, with or without quotes are valid in Yaml. Not sure what needs to be changed here. Indeed if you are planning to add a ":" inside a string in Yaml you must add quotes around it

Regarding the configuration to channelized interface, I would recommend to personnalize your common role locally or to create a dedicated role for it It would be a good addition to the small library of roles I have started to build here : https://github.com/JNPRAutomate/ansible-lib-roles

This project needs more attention but, if you want to create a junos-channelized you are more than welcome

ksator commented 7 years ago

Hello @dgarros, I edited my previous comment to fix the typo (indeed the 2 examples were the same :-)), sorry for the typo. I think we just should just add a note in the doc about channelized interfaces: we need to quotes them and we need to rechannelized them.