On this page
Source – Cisco NX-OS Ansible Best Practices
Overview
Summary of Cisco Nexus-as-Code and Ansible documentation used to define DC 3.0 network automation patterns for Cisco NX-OS.
Context
These sources define how NX-OS automation should be structured and executed: role-based playbook design, supported connection methods, module-first implementation, and replace deployment behavior.
Decisions
- Use role-based playbook structure with inventory groups and
group_vars/host_varsseparation for deterministic reuse. - Standardize on
cisco.nxosFQCN modules for idempotent tasks and reservenxos_configfor gaps and full replace. - Run AAP workflow stages with explicit precheck, approval, deploy, and postcheck gates.
- Baseline evidence capture on Ansible + vendor CLI command profiles with parser/version metadata for drift comparisons.
- Keep full configuration replace anchored to ADR-002 and NX-OS vendor guidance.
Current State
- Cisco Nexus-as-Code guidance and the Ansible
cisco.nxoscollection are now the normative references for NX-OS playbook design in DC 3.0. - Connection baseline is aligned to current Ansible platform options:
ansible.netcommon.network_cliandansible.netcommon.httpapi; deprecatedansible_connection: localis not used. - Deployment pattern aligns to documented module behavior: stage candidate config (for replace file path) and execute replace via
cisco.nxos.nxos_config(replace: config,replace_src). - Command-profile outputs are captured as raw CLI evidence and parser-normalized artifacts; parser/version pinning is required for drift reliability.
References
- Cisco DevNet Nexus-as-Code: Automating NX-OS using Ansible
- Ansible Cisco NX-OS collection documentation
- Ansible NX-OS platform options (CLI and NX-API)
- Ansible
cisco.nxos.nxos_configmodule - Ansible
cisco.nxos.nxos_commandmodule - Ansible
cisco.nxos.nxos_factsmodule - Ansible
cisco.nxos.nxos_file_copymodule
Future Work
- Re-validate this source note when major versions of the
cisco.nxoscollection or AAP are adopted. - Add module compatibility notes per supported NX-OS train used in production.