netascode / ansible-dc-vxlan

Ansible Collection for configuring a VXLAN Fabric using Direct to Controller (DTC) or Direct To Device (DTD) workflows.
https://galaxy.ansible.com/ui/repo/published/cisco/nac_dc_vxlan/
MIT License
6 stars 8 forks source link

Role: cisco.nac_dc_vxlan.dtc.create - Interface Access #7

Closed mikewiebe closed 6 months ago

mikewiebe commented 8 months ago

Role Entry Point: https://github.com/netascode/ansible-dc-vxlan/blob/main/roles/dtc/create/tasks/ndfc/main.yml#L31

This task captures the work items needed to enable configuration and deployment of access interfaces.

Jinja2 Template Contents

This template generates the payload used by the cisco.dcnm.dcnm_interface module to configure/manage access interfaces.

Module: https://github.com/CiscoDevNet/ansible-dcnm/blob/main/docs/cisco.dcnm.dcnm_interface_module.rst

---
# This NDFC loopback interface data is auto-generated
# DO NOT EDIT MANUALLY
#
{% for switch in MD.fabric.topology.switches %}
{% for interface in switch.interfaces %}
- name: {{ interface.name }}
  type: eth
  switch:
    - {{ switch.management.management_ipv4_address}}
  deploy: false
  profile:
    description: {{ interface.description | default(omit) }}
    admin_state: {{ interface.enabled | default(omit) }}
    mode: access
    ipv4_addr: {{ interface.ipv4_address | default(omit) }}

{% endfor %}
{% endfor %}

Sample Module Call For Access Interface:

    - name: Create ethernet interfaces
      cisco.dcnm.dcnm_interface: &eth_merge
        check_deploy: True
        fabric: "{{ ansible_it_fabric }}" 
        state: replaced                         # only choose form [merged, replaced, deleted, overridden, query]
          - name: "{{ ansible_eth_intf8 }}"   # should be of the form eth<port-id>
            type: eth                         # choose from this list [pc, vpc, sub_int, lo, eth, svi]
            switch:
              - "{{ ansible_switch1 }}"       # provide the switch information where the config is to be deployed
            deploy: true                      # choose from [true, false]
            profile:
              admin_state: true               # choose from [true, false]
              mode: access                    # choose from [trunk, access, routed, monitor, epl_routed]
              speed: 'Auto'                   # choose from ['Auto', '100Mb', '1Gb', '10Gb', '25Gb', '40Gb', '100Gb' ]
              bpdu_guard: true                # choose from [true, false, 'no']
              port_type_fast: true            # choose from [true, false]
              mtu: default                    # choose from [default, jumbo]
              access_vlan: 31                 # 
              cmds:                           # Freeform config
                - no shutdown
              description: "eth interface acting as access"
rrahimm commented 7 months ago

@mikewiebe

We observed that the supported MTU values for this interface type is enum (jumbo, default). but in schema it is mtu: int(min=1500, max=9216, required=False)

cc: @udmehrot

mikewiebe commented 7 months ago

@mikewiebe

We observed that the supported MTU values for this interface type is enum (jumbo, default). but in schema it is mtu: int(min=1500, max=9216, required=False)

cc: @udmehrot

The vision for the model was to support both direct to device and direct to controller. We are looking at how we can update the schema to support both a range and enum with the values default and jumbo