Deploy
VXLAN as Code

Step 1 - Execute Ansible Playbook

Up to this point, all of the switch, Interface, VRF, and Network configurations have been pushed to ND. However, their Config Status shows as Pending since you have yet to actually deploy this configuration. In this step, you will deploy the fabric configuration from the ND controller to the devices in the fabric.

Make sure you are in your root Ansible directory


cd ~/workspace/ndlab/nac

From the root Ansible project directory execute the following command:


ansible-playbook -i hosts.stage.yml vxlan.yml -t role_deploy

Upon a successful run of the playbook your output should look as follows:

    <... SNIP ...>

    PLAY RECAP *******************************************************************************************************************************************************************
    fabric-stage               : ok=237  changed=30   unreachable=0    failed=0    skipped=746  rescued=0    ignored=0


    PLAYBOOK RECAP ***************************************************************************************************************************************************************
    Playbook run took 0 days, 0 hours, 4 minutes, 45 seconds


    TASKS RECAP ******************************************************************************************************************************************************************
    Wednesday 01 October 2025  16:32:36 +0000 (0:00:00.244)       0:04:45.754 *****
    ===============================================================================
    cisco.nac_dc_vxlan.deploy : Deploy for iBGP VXLAN Fabric ------------------------------------------------------------------------------------------------------------ 183.80s
    cisco.nac_dc_vxlan.deploy : Config-Save for iBGP VXLAN Fabric -------------------------------------------------------------------------------------------------------- 26.69s
    cisco.nac_dc_vxlan.common : Get POAP Data From POAP Enabled Devices --------------------------------------------------------------------------------------------------- 1.82s
    cisco.nac_dc_vxlan.connectivity_check : Get Cisco Nexus Dashboard Fabric Controller Version --------------------------------------------------------------------------- 1.52s
    cisco.nac_dc_vxlan.deploy : Check Switch Sync in iBGP VXLAN Fabric ---------------------------------------------------------------------------------------------------- 1.15s
    cisco.nac_dc_vxlan.common : Build Fabric Creation Parameters From Template -------------------------------------------------------------------------------------------- 0.86s
    cisco.nac_dc_vxlan.connectivity_check : Verify Authorization to Nexus Dashboard --------------------------------------------------------------------------------------- 0.81s
    cisco.nac_dc_vxlan.common : Build Policy List From Template ----------------------------------------------------------------------------------------------------------- 0.68s
    cisco.nac_dc_vxlan.validate : Copy Service Model Data to Host --------------------------------------------------------------------------------------------------------- 0.68s
    cisco.nac_dc_vxlan.common : Retrieve NDFC Device Username and Password from Group Vars and update inv_config ---------------------------------------------------------- 0.66s
    cisco.nac_dc_vxlan.common : Build Fabric Switch Inventory List From Template ------------------------------------------------------------------------------------------ 0.66s
    cisco.nac_dc_vxlan.common : Build sub_interface ----------------------------------------------------------------------------------------------------------------------- 0.66s
    cisco.nac_dc_vxlan.common : Retrieve NDFC Device Username and Password from Group Vars and update inv_config ---------------------------------------------------------- 0.66s
    cisco.nac_dc_vxlan.common : Build Interface --------------------------------------------------------------------------------------------------------------------------- 0.65s
    cisco.nac_dc_vxlan.common : Build vPC interface ----------------------------------------------------------------------------------------------------------------------- 0.65s
    cisco.nac_dc_vxlan.common : Build Networks Attach List From Template -------------------------------------------------------------------------------------------------- 0.65s
    cisco.nac_dc_vxlan.common : Build Interface --------------------------------------------------------------------------------------------------------------------------- 0.64s
    cisco.nac_dc_vxlan.common : Build Interface --------------------------------------------------------------------------------------------------------------------------- 0.64s
    cisco.nac_dc_vxlan.common : Build Interface Po ------------------------------------------------------------------------------------------------------------------------ 0.63s
    cisco.nac_dc_vxlan.common : Build Interface --------------------------------------------------------------------------------------------------------------------------- 0.63s

    ROLES RECAP ******************************************************************************************************************************************************************
    Wednesday 01 October 2025  16:32:36 +0000 (0:00:00.247)       0:04:45.756 *****
    ===============================================================================
    deploy ---------------------------------------------------------------- 213.42s
    common ----------------------------------------------------------------- 59.73s
    validate ---------------------------------------------------------------- 5.39s
    connectivity_check ------------------------------------------------------ 3.98s
    common_global ----------------------------------------------------------- 0.05s
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    total ----------------------------------------------------------------- 282.56s

Step 2 - Return to ND & Verify Deployment

Return to your ND browser window and verify the deployment of the fabric configuration.

  1. Click the Switches tab in the top navigation bar

  2. Verify you see you switches in the Config Status as In-Sync. If not, please click the refresh button to the right of the Actions button


  3. Scroll to the right and verify the vPC relationship



  4. Click Interfaces
  5. There will be many interfaces, but you should now be able to confirm interface configurations to your switches



  6. Click the Networks tab in the top navigation bar
  7. Verify you see the Networks NaC-Net01 and NaC-Net02 now Deployed.
  8. Double-click NaC-Net01 to review the Network details



  9. Click Network Attachments
  10. Confirm NaC-Net01 is now Deployed and Attached to your switches



  11. Click VRFs
  12. Confirm NaC-VRF01 is associated to NaC-Net01 and Deployed to your switches
  13. Click the close button



  14. Click the VRFs tab in the top navigation bar
  15. Verify you see the VRF NaC-VRF01 now with a Deployed status
  16. Double-click NaC-VRF01 to review the VRF details



  17. Click VRF Attachments
  18. Confirm NaC-VRF01 is now Deployed and Attached to your switches



  19. Click Networks
  20. Confirm NaC-Net01 and NaC-Net02 is associated to NaC-VRF01 and Deployed to your switches
  21. Click the close button



  22. Click the Overview tab in the top navigation bar
  23. Verify your overall fabric deployment status


Congratulations!
You have automated the build of a functional VXLAN EVPN fabric in a staging environment!

In the next section, you will extend connectivity between your VXLAN EVPN fabric and an external environment.


Continue to the next section to checkout how to remove things from your VXLAN EVPN fabric.