Skip to content

Instantly share code, notes, and snippets.

@IPvSean
Created February 11, 2020 18:11
Show Gist options
  • Save IPvSean/028b36bab5783dfd4f4a01a2c4063613 to your computer and use it in GitHub Desktop.
Save IPvSean/028b36bab5783dfd4f4a01a2c4063613 to your computer and use it in GitHub Desktop.
problems with eos_vlans

on_box:->

        - name: desktops
          vlan_id: 20
        - name: servers
          vlan_id: 30
        - name: printers
          vlan_id: 40
        - name: DMZ
          vlan_id: 50
        - name: blah
          vlan_id: 80
        - name: artisanal_vlan
          vlan_id: 100

data_model sent->

          - name: desktops
            vlan_id: 20
          - name: sean
            vlan_id: 80
          - name: printers
            vlan_id: 40
          - name: DMZ
            vlan_id: 60

expected to happen->

  • vlan20-> same, no change

  • vlan30 and name server are not being sent, so this should be left alone

  • vlan40-> same, no change

  • vlan50-> this is where I am unsure.... I would expect either vlan50 is removed because the name DMZ moves to vlan 60 OR vlan60 just has the same name as vlan50 on the end box.... I think we KNOW that vlans HAVE to be unique so I would imagine we just append, so this behavior is correct

  • vlan80 exists on box with name blah, the data model being sent has it with name sean, i would expect most likely the vlan-id would just switch to name sean

what happened->

in reality we now have this a problem

50    DMZ                              active
60    DMZ                              active
80    VLAN0080                         active

it just appends a new vlan (not sure how this is different then merge) for the dmz and it for some reason just unnamed vlan80.... you can literally see it do it->

  commands:
  - vlan 80
  - name sean
  - no name
  - vlan 60
  - name DMZ

verbose output

TASK [add VLAN configuration] ***********************************************************************
changed: [rtr4] => changed=true
  after:
  - name: desktops
    vlan_id: 20
  - name: servers
    vlan_id: 30
  - name: printers
    vlan_id: 40
  - name: DMZ
    vlan_id: 50
  - name: DMZ
    vlan_id: 60
  - name: sean
    vlan_id: 80
  ansible_facts:
    discovered_interpreter_python: /usr/bin/python
  before:
  - name: desktops
    vlan_id: 20
  - name: servers
    vlan_id: 30
  - name: printers
    vlan_id: 40
  - name: DMZ
    vlan_id: 50
  - vlan_id: 80
  commands:
  - vlan 80
  - name sean
  - vlan 60
  - name DMZ
changed: [rtr2] => changed=true
  after:
  - name: desktops
    vlan_id: 20
  - name: servers
    vlan_id: 30
  - name: printers
    vlan_id: 40
  - name: DMZ
    vlan_id: 50
  - name: DMZ
    vlan_id: 60
  - vlan_id: 80
  - name: artisanal_vlan
    vlan_id: 100
  ansible_facts:
    discovered_interpreter_python: /usr/bin/python
  before:
  - name: desktops
    vlan_id: 20
  - name: servers
    vlan_id: 30
  - name: printers
    vlan_id: 40
  - name: DMZ
    vlan_id: 50
  - name: blah
    vlan_id: 80
  - name: artisanal_vlan
    vlan_id: 100
  commands:
  - vlan 80
  - name sean
  - no name
  - vlan 60
  - name DMZ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment