Debian Codegraph @

ansible_collections/cisco/ios/docs/cisco.ios.ios_lacp_module.rst

raw
1 .. _cisco.ios.ios_lacp_module:
2
3
4 ******************
5 cisco.ios.ios_lacp
6 ******************
7
8 **Resource module to configure LACP.**
9
10
11 Version added: 1.0.0
12
13 .. contents::
14 :local:
15 :depth: 1
16
17
18 Synopsis
19 --------
20 - This module provides declarative management of Global LACP on Cisco IOS network devices.
21
22
23
24
25 Parameters
26 ----------
27
28 .. raw:: html
29
30 <table border=0 cellpadding=0 class="documentation-table">
31 <tr>
32 <th colspan="3">Parameter</th>
33 <th>Choices/<font color="blue">Defaults</font></th>
34 <th width="100%">Comments</th>
35 </tr>
36 <tr>
37 <td colspan="3">
38 <div class="ansibleOptionAnchor" id="parameter-"></div>
39 <b>config</b>
40 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
41 <div style="font-size: small">
42 <span style="color: purple">dictionary</span>
43 </div>
44 </td>
45 <td>
46 </td>
47 <td>
48 <div>The provided configurations.</div>
49 </td>
50 </tr>
51 <tr>
52 <td class="elbow-placeholder"></td>
53 <td colspan="2">
54 <div class="ansibleOptionAnchor" id="parameter-"></div>
55 <b>system</b>
56 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
57 <div style="font-size: small">
58 <span style="color: purple">dictionary</span>
59 </div>
60 </td>
61 <td>
62 </td>
63 <td>
64 <div>This option sets the default system parameters for LACP.</div>
65 </td>
66 </tr>
67 <tr>
68 <td class="elbow-placeholder"></td>
69 <td class="elbow-placeholder"></td>
70 <td colspan="1">
71 <div class="ansibleOptionAnchor" id="parameter-"></div>
72 <b>priority</b>
73 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
74 <div style="font-size: small">
75 <span style="color: purple">integer</span>
76 / <span style="color: red">required</span>
77 </div>
78 </td>
79 <td>
80 </td>
81 <td>
82 <div>LACP priority for the system.</div>
83 <div>Refer to vendor documentation for valid values.</div>
84 </td>
85 </tr>
86
87
88 <tr>
89 <td colspan="3">
90 <div class="ansibleOptionAnchor" id="parameter-"></div>
91 <b>running_config</b>
92 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
93 <div style="font-size: small">
94 <span style="color: purple">string</span>
95 </div>
96 </td>
97 <td>
98 </td>
99 <td>
100 <div>This option is used only with state <em>parsed</em>.</div>
101 <div>The value of this option should be the output received from the IOS device by executing the command <b>show lacp sys-id</b>.</div>
102 <div>The state <em>parsed</em> reads the configuration from <code>running_config</code> option and transforms it into Ansible structured data as per the resource module&#x27;s argspec and the value is then returned in the <em>parsed</em> key within the result.</div>
103 </td>
104 </tr>
105 <tr>
106 <td colspan="3">
107 <div class="ansibleOptionAnchor" id="parameter-"></div>
108 <b>state</b>
109 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
110 <div style="font-size: small">
111 <span style="color: purple">string</span>
112 </div>
113 </td>
114 <td>
115 <ul style="margin: 0; padding: 0"><b>Choices:</b>
116 <li><div style="color: blue"><b>merged</b>&nbsp;&larr;</div></li>
117 <li>replaced</li>
118 <li>overridden</li>
119 <li>deleted</li>
120 <li>rendered</li>
121 <li>parsed</li>
122 <li>gathered</li>
123 </ul>
124 </td>
125 <td>
126 <div>The state the configuration should be left in</div>
127 <div>The module have declaratively similar behavior for replaced and overridden state.</div>
128 <div>The states <em>rendered</em>, <em>gathered</em> and <em>parsed</em> does not perform any change on the device.</div>
129 <div>The state <em>rendered</em> will transform the configuration in <code>config</code> option to platform specific CLI commands which will be returned in the <em>rendered</em> key within the result. For state <em>rendered</em> active connection to remote host is not required.</div>
130 <div>The state <em>gathered</em> will fetch the running configuration from device and transform it into structured data in the format as per the resource module argspec and the value is returned in the <em>gathered</em> key within the result.</div>
131 <div>The state <em>parsed</em> reads the configuration from <code>running_config</code> option and transforms it into JSON format as per the resource module parameters and the value is returned in the <em>parsed</em> key within the result. The value of <code>running_config</code> option should be the same format as the output of command <em>show running-config | include ip route|ipv6 route</em> executed on device. For state <em>parsed</em> active connection to remote host is not required.</div>
132 </td>
133 </tr>
134 </table>
135 <br/>
136
137
138 Notes
139 -----
140
141 .. note::
142 - Tested against Cisco IOSXE Version 17.3 on CML.
143 - This module works with connection ``network_cli``. See https://docs.ansible.com/ansible/latest/network/user_guide/platform_ios.html
144
145
146
147 Examples
148 --------
149
150 .. code-block:: yaml
151
152 # Using merged
153 #
154 # Before state:
155 # -------------
156 #
157 # vios#show lacp sys-id
158 # 32768, 5e00.0000.8000
159
160 - name: Merge provided configuration with device configuration
161 cisco.ios.ios_lacp:
162 config:
163 system:
164 priority: 123
165 state: merged
166
167 # After state:
168 # ------------
169 #
170 # vios#show lacp sys-id
171 # 123, 5e00.0000.8000
172
173 # Using replaced
174 #
175 # Before state:
176 # -------------
177 #
178 # vios#show lacp sys-id
179 # 500, 5e00.0000.8000
180
181 - name: Replaces Global LACP configuration
182 cisco.ios.ios_lacp:
183 config:
184 system:
185 priority: 123
186 state: replaced
187
188 # After state:
189 # ------------
190 #
191 # vios#show lacp sys-id
192 # 123, 5e00.0000.8000
193
194 # Using Deleted
195 #
196 # Before state:
197 # -------------
198 #
199 # vios#show lacp sys-id
200 # 500, 5e00.0000.8000
201
202 - name: Delete Global LACP attribute
203 cisco.ios.ios_lacp:
204 state: deleted
205
206 # After state:
207 # -------------
208 #
209 # vios#show lacp sys-id
210 # 32768, 5e00.0000.8000
211
212 # Using Gathered
213
214 # Before state:
215 # -------------
216 #
217 # vios#show lacp sys-id
218 # 123, 5e00.0000.8000
219
220 - name: Gather listed LACP with provided configurations
221 cisco.ios.ios_lacp:
222 config:
223 state: gathered
224
225 # Module Execution Result:
226 # ------------------------
227 #
228 # "gathered": {
229 # "system": {
230 # "priority": 500
231 # }
232 # }
233
234 # After state:
235 # ------------
236 #
237 # vios#show lacp sys-id
238 # 123, 5e00.0000.8000
239
240 # Using Rendered
241
242 - name: Render the commands for provided configuration
243 cisco.ios.ios_lacp:
244 config:
245 system:
246 priority: 123
247 state: rendered
248
249 # Module Execution Result:
250 # ------------------------
251 #
252 # "rendered": [
253 # "lacp system-priority 10"
254 # ]
255
256 # Using Parsed
257
258 # File: parsed.cfg
259 # ----------------
260 #
261 # lacp system-priority 123
262
263 - name: Parse the commands for provided configuration
264 cisco.ios.ios_lacp:
265 running_config: "{{ lookup('file', 'parsed.cfg') }}"
266 state: parsed
267
268 # Module Execution Result:
269 # ------------------------
270 #
271 # "parsed": {
272 # "system": {
273 # "priority": 123
274 # }
275 # }
276
277
278
279 Return Values
280 -------------
281 Common return values are documented `here <https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module:
282
283 .. raw:: html
284
285 <table border=0 cellpadding=0 class="documentation-table">
286 <tr>
287 <th colspan="1">Key</th>
288 <th>Returned</th>
289 <th width="100%">Description</th>
290 </tr>
291 <tr>
292 <td colspan="1">
293 <div class="ansibleOptionAnchor" id="return-"></div>
294 <b>after</b>
295 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
296 <div style="font-size: small">
297 <span style="color: purple">list</span>
298 </div>
299 </td>
300 <td>when changed</td>
301 <td>
302 <div>The configuration as structured data after module completion.</div>
303 <br/>
304 <div style="font-size: smaller"><b>Sample:</b></div>
305 <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">The configuration returned will always be in the same format
306 of the parameters above.</div>
307 </td>
308 </tr>
309 <tr>
310 <td colspan="1">
311 <div class="ansibleOptionAnchor" id="return-"></div>
312 <b>before</b>
313 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
314 <div style="font-size: small">
315 <span style="color: purple">list</span>
316 </div>
317 </td>
318 <td>always</td>
319 <td>
320 <div>The configuration as structured data prior to module invocation.</div>
321 <br/>
322 <div style="font-size: smaller"><b>Sample:</b></div>
323 <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">The configuration returned will always be in the same format
324 of the parameters above.</div>
325 </td>
326 </tr>
327 <tr>
328 <td colspan="1">
329 <div class="ansibleOptionAnchor" id="return-"></div>
330 <b>commands</b>
331 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
332 <div style="font-size: small">
333 <span style="color: purple">list</span>
334 </div>
335 </td>
336 <td>always</td>
337 <td>
338 <div>The set of commands pushed to the remote device.</div>
339 <br/>
340 <div style="font-size: smaller"><b>Sample:</b></div>
341 <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">[&#x27;lacp system-priority 10&#x27;]</div>
342 </td>
343 </tr>
344 </table>
345 <br/><br/>
346
347
348 Status
349 ------
350
351
352 Authors
353 ~~~~~~~
354
355 - Sumit Jaiswal (@justjais)