Automating site deployments using Network and Switch templates with Ansible or Python+API

WojtekMitus
New here

Automating site deployments using Network and Switch templates with Ansible or Python+API

Hello, we are evaluating using Meraki solutions to deploy networks in office buildings of various sizes, and i would like to do deployments entirely in IaC model, leveraging Network Templates and Switch Templates to reuse standarized configurations as much as possible.

As i was not able to find a guide for such deployments, i would like to ask few questions here.

 

1. What would be proper workflow for defining and applying reusable configuration in dashboard? I'm assuming:

  - Create Network Template and configure all template configurations according to the needs

  - Create and configure Switch Templates inside a Network Template, which could be attached later to real devices

  - Create a Network from a Network Template - an actual site

  - Claim devices into the Network

  - Attach switch templates to devices, define and build switch stacks in the actual deployed Network (there are no stack templates, right?)

  - Configure exceptions on actual switch ports which would have to differ from applied templates

 

  Is this correct?

 

 2. Currently i am trying to map particular dashboard functions to appropriate Ansible modules which would configure that option, and i am not able to find a module for creating a Switch Template inside a Network Template, and configure ports in this template. Which module allows to do this?

 

 3. The same goes for API documentation, i am not able to find which API call would create Switch Templates in a Network Template and configure the ports in newly created Switch Template. I guess there is an API for that?

 

Thanks,

Wojtek

 

 

 

 

2 Replies 2
VivekT
Getting noticed

As far as I know ,currently, Meraki's API does not provide specific endpoints to directly create or manage Switch Templates within Network Templates. The Dashboard API is more focused on device and network-level configurations rather than templates.

 

 

Template Management:

  • You can create and manage templates via the API using the /organizations/{organizationId}/configTemplates endpoint.
  • Example: Creating a new template or binding a network to a template.

     

    Switch Ports Configuration:

    • The /devices/{serial}/switchPorts endpoint lets you configure ports, but this applies to individual switches in deployed networks rather than templates.

       

       

       

       

       

       

      Suggestions and Alternatives

      1. Manual Template Setup:

        • Since templates must be set up manually, you can focus on using APIs or Ansible modules to automate device-specific configurations post-deployment.
      2. Scripted Automation:

        • For now, use scripts or automation workflows to configure networks/devices systematically after applying templates.
      3. Hybrid Approach:

        • Combine manual template creation with automated per-device configuration using Ansible or Python scripts to bridge the gap.
      Please let me know if it helps.
VivekT
Getting noticed

As far as I know ,currently, Meraki's API does not provide specific endpoints to directly create or manage Switch Templates within Network Templates. The Dashboard API is more focused on device and network-level configurations rather than templates.

 

 

Template Management:

  • You can create and manage templates via the API using the /organizations/{organizationId}/configTemplates endpoint.
  • Example: Creating a new template or binding a network to a template.

     

    Switch Ports Configuration:

    • The /devices/{serial}/switchPorts endpoint lets you configure ports, but this applies to individual switches in deployed networks rather than templates.

       

       

       

       

       

      Suggestions and Alternatives

      1. Manual Template Setup:

        • Since templates must be set up manually, you can focus on using APIs or Ansible modules to automate device-specific configurations post-deployment.
      2. Scripted Automation:

        • For now, use scripts or automation workflows to configure networks/devices systematically after applying templates.
      3. Hybrid Approach:

        • Combine manual template creation with automated per-device configuration using Ansible or Python scripts to bridge the gap.
      Please let me know if it help
Get notified when there are additional replies to this discussion.