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
Section titled “Diagram”Classes
Section titled “Classes”devices (nxos)
Section titled “devices (nxos)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| name | String | Yes | ||
| url | String | Yes | ||
| device_groups | List | String | No | |
| variables | Map | No | ||
| templates | List | String | No |
Examples
Section titled “Examples”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.2Example 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.2Example 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