Hi all,
I have been working with the AOS-CX role for a while and decided to see if I could improve the speed of administration of VLANs with aoscx_vlan. Currently I am have them all in a vars file like:
vlans:
- {vlanid: '4', vlanname: 'vlan0004', vlanadminstate: 'up', vlanstate: 'create'}
- {vlanid: '8', vlanname: 'vlan0008', vlanadminstate: 'up', vlanstate: 'create'}
....
- {vlanid: '399', vlanname: '
vlan4000', vlanstate: 'delete'}
- {vlanid: '4000', vlanname: '
vlan4000', vlanadminstate: 'up', vlanstate: 'create'}
and the task is:
- name: Create VLANs
aoscx_vlan:
vlan_id: "{{ item.vlanid }}"
name: "{{ item.vlanname }}"
admin_state: "{{ item.vlanadminstate | default(omit) }}"
state: "{{ item.vlanstate }}"
loop: "{{ vlans | flatten (levels=1) }}"
My vars file has about 80 vlans defined and takes about 50 seconds per switch to run. Not terrible, but you can see where this will be a bottleneck once getting past a handful of switches.
I did a bit of research and found a few Ansible config changes to try, it saved about 1 second off the time. Found other suggestions that were module specific which the aoscx_vlan module does not support, aggregate (eos module), src + jinja template (nxos module).
Any suggestions to improve this workflow?
------------------------------
Don Rhodes
------------------------------