cisco.ios.ios_vxlan_vtep module – Resource module to configure VXLAN VTEP interface.

Note

This module is part of the cisco.ios collection (version 9.0.3).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install cisco.ios.

To use it in a playbook, specify: cisco.ios.ios_vxlan_vtep.

New in cisco.ios 5.3.0

Synopsis

  • This module provides declarative management of VXLAN VTEP interface on Cisco IOS network devices.

Aliases: vxlan_vtep

Parameters

Parameter

Comments

config

list / elements=dictionary

A dictionary of VXLAN VTEP interface option

host_reachability_bgp

boolean

Host reachability using EVPN protocol

Choices:

  • false

  • true

interface

string / required

VXLAN VTEP interface

member

dictionary

Configure VNI member

vni

dictionary

Configure VNI information

l2vni

list / elements=dictionary

Associates L2VNI with the VXLAN VTEP interface

replication

dictionary

Replication type for the L2VNI

mcast_group

dictionary

Configure multicast group for VNI(s)

ipv4

string

IPv4 multicast group

ipv6

string

IPv6 multicast group

type

string

Replication type

Choices:

  • "ingress"

  • "static"

vni

integer

VNI number

l3vni

list / elements=dictionary

Associates L3VNI with the VXLAN VTEP interface

vni

integer

VNI number

vrf

string

VRF name of the L3VNI

source_interface

string

Source interface for the VXLAN VTEP interface

running_config

string

This option is used only with state parsed.

The value of this option should be the output received from the IOS device by executing the command show running-config | section ^interface nve.

The state parsed reads the configuration from running_config option and transforms it into Ansible structured data as per the resource module’s argspec and the value is then returned in the parsed key within the result.

state

string

The state the configuration should be left in

Choices:

  • "merged" ← (default)

  • "replaced"

  • "overridden"

  • "deleted"

  • "rendered"

  • "gathered"

  • "parsed"

Notes

Note

Examples

# Using state merged

# Before state:
# -------------
# interface nve1
#  no ip address
#  source-interface Loopback1
#  host-reachability protocol bgp
#  member vni 10101 mcast-group 225.0.0.101
#  member vni 10102 ingress-replication
#  member vni 50901 vrf green
#  member vni 10201 mcast-group 225.0.0.101
#  member vni 10202 ingress-replication
#  member vni 50902 vrf blue

# - name: Merge the provided configuration with the device configuration
#   cisco.ios.ios_vxlan_vtep:
#     config:
#     - interface: nve1
#       source_interface: loopback2
#       member:
#         vni:
#           l2vni:
#             - vni: 10101
#               replication:
#                 type: ingress
#             - vni: 10201
#               replication:
#                 type: static
#                 mcast_group:
#                   ipv4: 225.0.0.101
#                   ipv6: FF0E:225::101
#           l3vni:
#             - vni: 50901
#               vrf: blue
#     state: merged

# Commands Fired:
# ---------------
#   "commands": [
#         "interface nve1",
#         "source-interface loopback2",
#         "no member vni 10101 mcast-group 225.0.0.101",
#         "member vni 10101 ingress-replication",
#         "no member vni 10201 mcast-group 225.0.0.101",
#         "member vni 10201 mcast-group 225.0.0.101 FF0E:225::101",
#         "no member vni 50901 vrf green",
#         "no member vni 50902 vrf blue",
#         "member vni 50901 vrf blue"
#   ],

# After state:
# ------------
# interface nve1
#  no ip address
#  source-interface Loopback2
#  host-reachability protocol bgp
#  member vni 10102 ingress-replication
#  member vni 10202 ingress-replication
#  member vni 10101 ingress-replication
#  member vni 10201 mcast-group 225.0.0.101 FF0E:225::101
#  member vni 50901 vrf blue

# Using state replaced

# Before state:
# -------------
# interface nve1
#  no ip address
#  source-interface Loopback2
#  host-reachability protocol bgp
#  member vni 10102 ingress-replication
#  member vni 10202 ingress-replication
#  member vni 10101 ingress-replication
#  member vni 10201 mcast-group 225.0.0.101 FF0E:225::101
#  member vni 50901 vrf blue

# - name: Replaces the device configuration with the provided configuration
#   cisco.ios.ios_vxlan_vtep:
#     config:
#     - interface: nve1
#       source_interface: Loopback2
#       member:
#         vni:
#           l2vni:
#             - vni: 10101
#               replication:
#                 type: static
#                 mcast_group:
#                   ipv6: FF0E:225::101
#             - vni: 10201
#               replication:
#                 type: static
#                 mcast_group:
#                   ipv6: FF0E:225::102
#     state: replaced

# Commands Fired:
# ---------------
#   "commands": [
#       "interface nve1",
#       "no member vni 10101 ingress-replication",
#       "member vni 10101 mcast-group FF0E:225::101",
#       "no member vni 10201 mcast-group 225.0.0.101 FF0E:225::101",
#       "member vni 10201 mcast-group FF0E:225::102",
#       "no member vni 10102 ingress-replication",
#       "no member vni 10202 ingress-replication",
#       "no member vni 50901 vrf blue"
#   ],

# After state:
# ------------
# interface nve1
#  no ip address
#  source-interface Loopback2
#  host-reachability protocol bgp
#  member vni 10101 mcast-group FF0E:225::101
#  member vni 10201 mcast-group FF0E:225::102

# Using state Deleted

# Before state:
# -------------
# interface nve1
#  no ip address
#  source-interface Loopback2
#  host-reachability protocol bgp
#  member vni 10101 mcast-group FF0E:225::101
#  member vni 10201 mcast-group FF0E:225::102

# - name: "Delete VXLAN VTEP interface"
#   cisco.ios.ios_vxlan_vtep:
#     config:
#     - interface: nve1
#     state: deleted

# Commands Fired:
# ---------------
#   "commands": [
#       "interface nve1",
#       "no source-interface Loopback2",
#       "no host-reachability protocol bgp",
#       "no member vni 10101 mcast-group FF0E:225::101",
#       "no member vni 10201 mcast-group FF0E:225::102"
#   ],

# After state:
# -------------
# interface nve1
#  no ip address

# Using state Deleted with member VNIs

# Before state:
# -------------
# interface nve1
#  no ip address
#  source-interface Loopback2
#  host-reachability protocol bgp
#  member vni 10101 mcast-group FF0E:225::101
#  member vni 10102 mcast-group 225.0.0.101
#  member vni 10201 mcast-group 225.0.0.101 FF0E:225::101

# - name: "Delete VXLAN VTEP interface with member VNIs"
#   cisco.ios.ios_vxlan_vtep:
#     config:
#     - interface: nve1
#       source_interface: Loopback2
#       member:
#         vni:
#           l2vni:
#             - vni: 10101
#             - vni: 10102
#     state: deleted

# Commands Fired:
# ---------------
#   "commands": [
#       "interface nve1",
#       "no member vni 10101 mcast-group FF0E:225::101",
#       "no member vni 10102 mcast-group 225.0.0.101"
#   ],

# After state:
# -------------
# interface nve1
#  no ip address
#  source-interface Loopback2
#  host-reachability protocol bgp
#  member vni 10201 mcast-group 225.0.0.101 FF0E:225::101

# Using state Deleted with no config

# Before state:
# -------------
# interface nve1
#  no ip address
#  source-interface Loopback2
#  host-reachability protocol bgp
#  member vni 10101 mcast-group FF0E:225::101
#  member vni 10201 mcast-group FF0E:225::102

# - name: "Delete VXLAN VTEP interface with no config"
#   cisco.ios.ios_vxlan_vtep:
#     state: deleted

# Commands Fired:
# ---------------
#   "commands": [
#       "interface nve1",
#       "no source-interface Loopback2",
#       "no host-reachability protocol bgp",
#       "no member vni 10101 mcast-group FF0E:225::101",
#       "no member vni 10201 mcast-group FF0E:225::102"
#   ],

# After state:
# -------------
# interface nve1
#  no ip address

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

after

dictionary

The resulting configuration after module execution.

Returned: when changed

Sample: "This output will always be in the same format as the module argspec.\n"

before

dictionary

The configuration prior to the module execution.

Returned: when state is merged, replaced, overridden, deleted or purged

Sample: "This output will always be in the same format as the module argspec.\n"

commands

list / elements=string

The set of commands pushed to the remote device.

Returned: when state is merged, replaced, overridden, deleted or purged

Sample: ["interface nve1", "source-interface Loopback1", "host-reachability protocol bgp", "member vni 10101 ingress-replication"]

Authors

  • Padmini Priyadarshini Sivaraj (@PadminiSivaraj)