cisco.meraki.meraki_static_route – Manage static routes in the Meraki cloud
Note
This plugin is part of the cisco.meraki collection (version 2.1.3).
To install it use: ansible-galaxy collection install cisco.meraki.
To use it in a playbook, specify: cisco.meraki.meraki_static_route.
Synopsis
- Allows for creation, management, and visibility into static routes within Meraki.
Parameters
| Parameter | Choices/Defaults | Comments | |
|---|---|---|---|
| auth_key  string / required  | Authentication key provided by the dashboard. Required if environmental variable  MERAKI_KEYis not set. | ||
| enabled  boolean  | 
 | Indicates whether static route is enabled within a network. | |
| fixed_ip_assignments  list / elements=dictionary  | List of fixed MAC to IP bindings for DHCP. | ||
| ip  string  | IP address of endpoint. | ||
| mac  string  | MAC address of endpoint. | ||
| name  string  | Hostname of endpoint. | ||
| gateway_ip  string  | IP address of the gateway for the subnet. | ||
| host  string  | Default: "api.meraki.com" | Hostname for Meraki dashboard. Can be used to access regional Meraki environments, such as China. | |
| internal_error_retry_time  integer  | Default: 60 | Number of seconds to retry if server returns an internal server error. | |
| name  string  | Descriptive name of the static route. | ||
| net_id  string  | ID number of a network. | ||
| net_name  string  | Name of a network. | ||
| org_id  string  | ID of organization. | ||
| org_name  string  | Name of organization. aliases: organization | ||
| output_format  string  | 
 | Instructs module whether response keys should be snake case (ex.  net_id) or camel case (ex.netId). | |
| output_level  string  | 
 | Set amount of debug output during module execution. | |
| rate_limit_retry_time  integer  | Default: 165 | Number of seconds to retry if rate limiter is triggered. | |
| reserved_ip_ranges  list / elements=dictionary  | List of IP ranges reserved for static IP assignments. | ||
| comment  string  | Human readable description of reservation range. | ||
| end  string  | Last IP address of reserved range. | ||
| start  string  | First IP address of reserved range. | ||
| route_id  string  | Unique ID of static route. | ||
| state  string  | 
 | Create or modify an organization. | |
| subnet  string  | CIDR notation based subnet for static route. | ||
| timeout  integer  | Default: 30 | Time to timeout for HTTP requests. | |
| use_https  boolean  | 
 | If  no, it will use HTTP. Otherwise it will use HTTPS.Only useful for internal Meraki developers. | |
| use_proxy  boolean  | 
 | If  no, it will not use a proxy, even if one is defined in an environment variable on the target hosts. | |
| validate_certs  boolean  | 
 | Whether to validate HTTP certificates. | |
Notes
Note
- More information about the Meraki API can be found at https://dashboard.meraki.com/api_docs.
- Some of the options are likely only used for developers within Meraki.
- As of Ansible 2.9, Meraki modules output keys as snake case. To use camel case, set the ANSIBLE_MERAKI_FORMATenvironment variable tocamelcase.
- Ansible’s Meraki modules will stop supporting camel case output in Ansible 2.13. Please update your playbooks.
- Check Mode downloads the current configuration from the dashboard, then compares changes against this download. Check Mode will report changed if there are differences in the configurations, but does not submit changes to the API for validation of change.
Examples
- name: Create static_route
  meraki_static_route:
    auth_key: abc123
    state: present
    org_name: YourOrg
    net_name: YourNet
    name: Test Route
    subnet: 192.0.1.0/24
    gateway_ip: 192.168.128.1
  delegate_to: localhost
- name: Update static route with fixed IP assignment
  meraki_static_route:
    auth_key: abc123
    state: present
    org_name: YourOrg
    net_name: YourNet
    route_id: d6fa4821-1234-4dfa-af6b-ae8b16c20c39
    fixed_ip_assignments:
      - mac: aa:bb:cc:dd:ee:ff
        ip: 192.0.1.11
        comment: Server
  delegate_to: localhost
- name: Query static routes
  meraki_static_route:
    auth_key: abc123
    state: query
    org_name: YourOrg
    net_name: YourNet
  delegate_to: localhost
- name: Delete static routes
  meraki_static_route:
    auth_key: abc123
    state: absent
    org_name: YourOrg
    net_name: YourNet
    route_id: '{{item}}'
  delegate_to: localhost
   Return Values
Common return values are documented here, the following are the fields unique to this module:
| Key | Returned | Description | |||
|---|---|---|---|---|---|
| data  complex  | info | Information about the created or manipulated object. | |||
| enabled  boolean  | query or update | Enabled state of static route. Sample: True | |||
| fixedIpAssignments  complex  | query or update | List of static MAC to IP address bindings. | |||
| mac  complex  | query or update | Key is MAC address of endpoint. | |||
| ip  string  | query or update | IP address to be bound to the endpoint. Sample: 192.0.1.11 | |||
| name  string  | query or update | Hostname given to the endpoint. Sample: JimLaptop | |||
| gatewayIp  string  | success | Next hop IP address. Sample: 192.1.1.1 | |||
| id  string  | success | Unique identification string assigned to each static route. Sample: d6fa4821-1234-4dfa-af6b-ae8b16c20c39 | |||
| name  string  | success | Name of static route. Sample: Data Center static route | |||
| net_id  string  | query or update | Identification string of network. Sample: N_12345 | |||
| reservedIpRanges  complex  | query or update | List of IP address ranges which are reserved for static assignment. | |||
| comment  string  | query or update | Human readable description of range. Sample: Server range | |||
| end  string  | query or update | Last address in reservation range, inclusive. Sample: 192.0.1.10 | |||
| start  string  | query or update | First address in reservation range, inclusive. Sample: 192.0.1.2 | |||
| subnet  string  | success | CIDR notation subnet for static route. Sample: 192.0.1.0/24 | |||
Authors
- Kevin Breit (@kbreit)
    © 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
    https://docs.ansible.com/ansible/2.10/collections/cisco/meraki/meraki_static_route_module.html