Debian Codegraph @

ansible_collections/cisco/meraki/plugins/modules/networks_appliance_vpn_bgp.py

raw
1 #!/usr/bin/python
2 # -*- coding: utf-8 -*-
3
4 # Copyright (c) 2021, Cisco Systems
5 # GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
6
7 DOCUMENTATION = r"""
8 module: networks_appliance_vpn_bgp
9 short_description: Resource module for networks _appliance _vpn _bgp
10 description:
11 - Manage operation update of the resource networks _appliance _vpn _bgp.
12 - Update a Hub BGP Configuration.
13 version_added: '1.0.0'
14 extends_documentation_fragment:
15 - cisco.meraki.module
16 author: Francisco Munoz (@fmunoz)
17 options:
18 asNumber:
19 description: An Autonomous System Number (ASN) is required if you are to run BGP
20 and peer with another BGP Speaker outside of the Auto VPN domain. This ASN will
21 be applied to the entire Auto VPN domain. The entire 4-byte ASN range is supported.
22 So, the ASN must be an integer between 1 and 4294967295. When absent, this field
23 is not updated. If no value exists then it defaults to 64512.
24 type: int
25 enabled:
26 description: Boolean value to enable or disable the BGP configuration. When BGP
27 is enabled, the asNumber (ASN) will be autopopulated with the preconfigured
28 ASN at other Hubs or a default value if there is no ASN configured.
29 type: bool
30 ibgpHoldTimer:
31 description: The iBGP holdtimer in seconds. The iBGP holdtimer must be an integer
32 between 12 and 240. When absent, this field is not updated. If no value exists
33 then it defaults to 240.
34 type: int
35 neighbors:
36 description: List of BGP neighbors. This list replaces the existing set of neighbors.
37 When absent, this field is not updated.
38 elements: dict
39 suboptions:
40 allowTransit:
41 description: When this feature is on, the Meraki device will advertise routes
42 learned from other Autonomous Systems, thereby allowing traffic between
43 Autonomous Systems to transit this AS. When absent, it defaults to false.
44 type: bool
45 authentication:
46 description: Authentication settings between BGP peers.
47 suboptions:
48 password:
49 description: Password to configure MD5 authentication between BGP peers.
50 type: str
51 type: dict
52 ebgpHoldTimer:
53 description: The eBGP hold timer in seconds for each neighbor. The eBGP hold
54 timer must be an integer between 12 and 240.
55 type: int
56 ebgpMultihop:
57 description: Configure this if the neighbor is not adjacent. The eBGP multi-hop
58 must be an integer between 1 and 255.
59 type: int
60 ip:
61 description: The IPv4 address of the neighbor.
62 type: str
63 ipv6:
64 description: Information regarding IPv6 address of the neighbor, Required
65 if `ip` is not present.
66 suboptions:
67 address:
68 description: The IPv6 address of the neighbor.
69 type: str
70 type: dict
71 multiExitDiscriminator:
72 description: Configures the local metric associated with routes received from
73 the remote peer. Routes from peers with lower metrics are will be preferred.
74 Must be an integer between 0 and 4294967295. MED is 6th in the decision
75 tree when identical routes from multiple peers exist.
76 type: int
77 nextHopIp:
78 description: The IPv4 address of the remote BGP peer that will establish a
79 TCP session with the local MX.
80 type: str
81 pathPrepend:
82 description: Prepends the AS_PATH BGP Attribute associated with routes received
83 from the remote peer. Configurable value of ASNs to prepend. Length of the
84 array may not exceed 10, and each ASN in the array must be an integer between
85 1 and 4294967295. AS_PATH is 4th in the decision tree when identical routes
86 from multiple peers exist.
87 elements: int
88 type: list
89 receiveLimit:
90 description: The receive limit is the maximum number of routes that can be
91 received from any BGP peer. The receive limit must be an integer between
92 0 and 2147483647. When absent, it defaults to 0.
93 type: int
94 remoteAsNumber:
95 description: Remote ASN of the neighbor. The remote ASN must be an integer
96 between 1 and 4294967295.
97 type: int
98 sourceInterface:
99 description: The output interface for peering with the remote BGP peer. Valid
100 values are 'wan{NUMBER}' (e.g. 'wan3') or 'vlan{VLAN ID}' (e.g. 'vlan123').
101 type: str
102 ttlSecurity:
103 description: Settings for BGP TTL security to protect BGP peering sessions
104 from forged IP attacks.
105 suboptions:
106 enabled:
107 description: Boolean value to enable or disable BGP TTL security.
108 type: bool
109 type: dict
110 weight:
111 description: Sets the local weight for routes received from the remote peer.
112 Routes from peers with higher weights will be preferred. Must be an integer
113 between 0 and 49.
114 type: int
115 type: list
116 networkId:
117 description: NetworkId path parameter. Network ID.
118 type: str
119 requirements:
120 - meraki >= 2.4.9
121 - python >= 3.5
122 seealso:
123 - name: Cisco Meraki documentation for appliance updateNetworkApplianceVpnBgp
124 description: Complete reference of the updateNetworkApplianceVpnBgp API.
125 link: https://developer.cisco.com/meraki/api-v1/#!update-network-appliance-vpn-bgp
126 notes:
127 - SDK Method used are
128 appliance.Appliance.update_network_appliance_vpn_bgp,
129 - Paths used are
130 put /networks/{networkId}/appliance/vpn/bgp,
131 """
132
133 EXAMPLES = r"""
134 - name: Update all
135 cisco.meraki.networks_appliance_vpn_bgp:
136 meraki_api_key: "{{ meraki_api_key }}"
137 meraki_base_url: "{{ meraki_base_url }}"
138 meraki_single_request_timeout: "{{ meraki_single_request_timeout }}"
139 meraki_certificate_path: "{{ meraki_certificate_path }}"
140 meraki_requests_proxy: "{{ meraki_requests_proxy }}"
141 meraki_wait_on_rate_limit: "{{ meraki_wait_on_rate_limit }}"
142 meraki_nginx_429_retry_wait_time: "{{ meraki_nginx_429_retry_wait_time }}"
143 meraki_action_batch_retry_wait_time: "{{ meraki_action_batch_retry_wait_time }}"
144 meraki_retry_4xx_error: "{{ meraki_retry_4xx_error }}"
145 meraki_retry_4xx_error_wait_time: "{{ meraki_retry_4xx_error_wait_time }}"
146 meraki_maximum_retries: "{{ meraki_maximum_retries }}"
147 meraki_output_log: "{{ meraki_output_log }}"
148 meraki_log_file_prefix: "{{ meraki_log_file_prefix }}"
149 meraki_log_path: "{{ meraki_log_path }}"
150 meraki_print_console: "{{ meraki_print_console }}"
151 meraki_suppress_logging: "{{ meraki_suppress_logging }}"
152 meraki_simulate: "{{ meraki_simulate }}"
153 meraki_be_geo_id: "{{ meraki_be_geo_id }}"
154 meraki_caller: "{{ meraki_caller }}"
155 meraki_use_iterator_for_get_pages: "{{ meraki_use_iterator_for_get_pages }}"
156 meraki_inherit_logging_config: "{{ meraki_inherit_logging_config }}"
157 state: present
158 asNumber: 64515
159 enabled: true
160 ibgpHoldTimer: 120
161 neighbors:
162 - allowTransit: true
163 authentication:
164 password: abc123
165 ebgpHoldTimer: 180
166 ebgpMultihop: 2
167 ip: 10.10.10.22
168 ipv6:
169 address: 2002::1234:abcd:ffff:c0a8:101
170 multiExitDiscriminator: 2
171 nextHopIp: 1.2.3.4
172 pathPrepend:
173 - 1
174 - 2
175 receiveLimit: 120
176 remoteAsNumber: 64343
177 sourceInterface: wan1
178 ttlSecurity:
179 enabled: false
180 weight: 10
181 networkId: string
182 """
183 RETURN = r"""
184 meraki_response:
185 description: A dictionary or list with the response returned by the Cisco Meraki Python SDK
186 returned: always
187 type: dict
188 sample: >
189 {
190 "enabled": true,
191 "asNumber": 0,
192 "ibgpHoldTimer": 0,
193 "neighbors": [
194 {
195 "ip": "string",
196 "ipv6": {
197 "address": "string"
198 },
199 "remoteAsNumber": 0,
200 "receiveLimit": 0,
201 "allowTransit": true,
202 "ebgpHoldTimer": 0,
203 "ebgpMultihop": 0,
204 "sourceInterface": "string",
205 "nextHopIp": "string",
206 "ttlSecurity": {
207 "enabled": true
208 },
209 "authentication": {
210 "password": "string"
211 },
212 "multiExitDiscriminator": 0,
213 "pathPrepend": [
214 0
215 ],
216 "weight": 0
217 }
218 ]
219 }
220 """