Skip to content

Device

Devices represent individual NX-OS network devices (switches, routers) that are configured and managed, each identified by a unique name and a management URL for connectivity. Device configurations have the highest precedence in the configuration hierarchy (Global → Device Group → Device), allowing you to override inherited settings for specific devices while maintaining consistency through group and global defaults. The managed attribute can be used to temporarily skip a device due to maintenance, and devices can be assigned to device groups, variables, and templates for flexible configuration management.

Diagram
NameTypeConstraintMandatoryDefault Value
nameStringYes
urlStringYes
device_groupsListStringNo
variablesMapNo
templatesListStringNo

Example 1: Basic device inventory with management URLs and group assignments

nxos:
devices:
- name: SPINE1
url: https://10.50.202.116
device_groups:
- SPINES
variables:
hostname: SPINE1
lo0_ip: 10.1.100.1
- name: SPINE2
url: https://10.50.202.117
device_groups:
- SPINES
variables:
hostname: SPINE2
lo0_ip: 10.1.100.2

Example 2: Leaf switches with VTEP variables and fabric group membership

nxos:
devices:
- name: LEAF1
url: https://10.50.202.118
device_groups:
- LEAFS
variables:
hostname: LEAF1
lo0_ip: 10.1.100.3
vtep_ip: 10.1.200.1
- name: LEAF2
url: https://10.50.202.119
device_groups:
- LEAFS
variables:
hostname: LEAF2
lo0_ip: 10.1.100.4
vtep_ip: 10.1.200.2

Example 3: Device with inline configuration override, multiple group memberships, and managed flag

nxos:
devices:
- name: BORDER-LEAF1
url: https://10.50.202.120
device_groups:
- LEAFS
- BORDERS
variables:
hostname: BORDER-LEAF1
lo0_ip: 10.1.100.5
vtep_ip: 10.1.200.3
configuration:
routing:
bgp:
asn: "65000"
neighbors:
- ip: 10.1.100.1
inherit_peer: SPINE-PEERS
- ip: 10.1.100.2
inherit_peer: SPINE-PEERS
templates:
- L3_SERVICE
- name: LEAF-MAINT
url: https://10.50.202.121
managed: false
device_groups:
- LEAFS
variables:
hostname: LEAF-MAINT
lo0_ip: 10.1.100.6