DevNet Associate (DEVASC) v1.0Cisco Platforms and DevelopmentMedium

A network engineer is using Ansible to automate configuration changes on a Cisco NX-OS switch. The Ansible playbook needs to push a new VLAN configuration to the switch. To achieve this, the engineer should utilize an Ansible module that interacts directly with the NX-OS device's native API for structured data exchange. Which Ansible module category is designed for this purpose on NX-OS?

  1. Acli_parse
  2. Braw
  3. Cnxos_config
  4. Dios_command
Show answer & explanation

Correct answer: C. nxos_config

The `nxos_config` Ansible module is specifically designed to manage the configuration of Cisco NX-OS devices in a structured, idempotent manner, leveraging the device's native APIs (like NX-API REST or NETCONF) under the hood to push configurations like VLANs.

Why the other options are wrong

  • A. `cli_parse` is used for parsing CLI output, not for pushing configurations.
  • B. `raw` module executes arbitrary commands without modules, which is not idempotent and lacks structured configuration features.
  • D. `ios_command` is for Cisco IOS devices and executes arbitrary CLI commands, not specific to NX-OS structured configuration.

Ansible `nxos_config` module

The Ansible `nxos_config` module is used to manage the configuration of Cisco NX-OS devices. It ensures idempotent configuration changes by comparing desired state with current state and applying only necessary modifications, often leveraging NX-API REST or NETCONF.

  • Idempotent configuration management.
  • Supports various configuration sections (VLANs, interfaces, etc.).
  • Leverages native NX-OS APIs for structured interaction.

Memory trick: Ansible modules for NX-OS are specialized tools for tasks.

More Cisco Platforms and Development questions