| 1 |
.. _cisco.nxos.nxos_bfd_interfaces_module: |
| 2 |
|
| 3 |
|
| 4 |
****************************** |
| 5 |
cisco.nxos.nxos_bfd_interfaces |
| 6 |
****************************** |
| 7 |
|
| 8 |
**BFD interfaces resource module** |
| 9 |
|
| 10 |
|
| 11 |
Version added: 1.0.0 |
| 12 |
|
| 13 |
.. contents:: |
| 14 |
:local: |
| 15 |
:depth: 1 |
| 16 |
|
| 17 |
|
| 18 |
Synopsis |
| 19 |
-------- |
| 20 |
- Manages attributes of Bidirectional Forwarding Detection (BFD) on the interface. |
| 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="2">Parameter</th> |
| 33 |
<th>Choices/<font color="blue">Defaults</font></th> |
| 34 |
<th width="100%">Comments</th> |
| 35 |
</tr> |
| 36 |
<tr> |
| 37 |
<td colspan="2"> |
| 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">list</span> |
| 43 |
/ <span style="color: purple">elements=dictionary</span> |
| 44 |
</div> |
| 45 |
</td> |
| 46 |
<td> |
| 47 |
</td> |
| 48 |
<td> |
| 49 |
<div>The provided configuration</div> |
| 50 |
</td> |
| 51 |
</tr> |
| 52 |
<tr> |
| 53 |
<td class="elbow-placeholder"></td> |
| 54 |
<td colspan="1"> |
| 55 |
<div class="ansibleOptionAnchor" id="parameter-"></div> |
| 56 |
<b>bfd</b> |
| 57 |
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> |
| 58 |
<div style="font-size: small"> |
| 59 |
<span style="color: purple">string</span> |
| 60 |
</div> |
| 61 |
</td> |
| 62 |
<td> |
| 63 |
<ul style="margin: 0; padding: 0"><b>Choices:</b> |
| 64 |
<li>enable</li> |
| 65 |
<li>disable</li> |
| 66 |
</ul> |
| 67 |
</td> |
| 68 |
<td> |
| 69 |
<div>Enable/Disable Bidirectional Forwarding Detection (BFD) on the interface.</div> |
| 70 |
</td> |
| 71 |
</tr> |
| 72 |
<tr> |
| 73 |
<td class="elbow-placeholder"></td> |
| 74 |
<td colspan="1"> |
| 75 |
<div class="ansibleOptionAnchor" id="parameter-"></div> |
| 76 |
<b>echo</b> |
| 77 |
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> |
| 78 |
<div style="font-size: small"> |
| 79 |
<span style="color: purple">string</span> |
| 80 |
</div> |
| 81 |
</td> |
| 82 |
<td> |
| 83 |
<ul style="margin: 0; padding: 0"><b>Choices:</b> |
| 84 |
<li>enable</li> |
| 85 |
<li>disable</li> |
| 86 |
</ul> |
| 87 |
</td> |
| 88 |
<td> |
| 89 |
<div>Enable/Disable BFD Echo functionality on the interface.</div> |
| 90 |
</td> |
| 91 |
</tr> |
| 92 |
<tr> |
| 93 |
<td class="elbow-placeholder"></td> |
| 94 |
<td colspan="1"> |
| 95 |
<div class="ansibleOptionAnchor" id="parameter-"></div> |
| 96 |
<b>name</b> |
| 97 |
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> |
| 98 |
<div style="font-size: small"> |
| 99 |
<span style="color: purple">string</span> |
| 100 |
</div> |
| 101 |
</td> |
| 102 |
<td> |
| 103 |
</td> |
| 104 |
<td> |
| 105 |
<div>The name of the interface.</div> |
| 106 |
</td> |
| 107 |
</tr> |
| 108 |
|
| 109 |
<tr> |
| 110 |
<td colspan="2"> |
| 111 |
<div class="ansibleOptionAnchor" id="parameter-"></div> |
| 112 |
<b>running_config</b> |
| 113 |
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> |
| 114 |
<div style="font-size: small"> |
| 115 |
<span style="color: purple">string</span> |
| 116 |
</div> |
| 117 |
</td> |
| 118 |
<td> |
| 119 |
</td> |
| 120 |
<td> |
| 121 |
<div>This option is used only with state <em>parsed</em>.</div> |
| 122 |
<div>The value of this option should be the output received from the NX-OS device by executing the command <b>show running-config | section '^interface|^feature bfd'</b>.</div> |
| 123 |
<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's argspec and the value is then returned in the <em>parsed</em> key within the result.</div> |
| 124 |
</td> |
| 125 |
</tr> |
| 126 |
<tr> |
| 127 |
<td colspan="2"> |
| 128 |
<div class="ansibleOptionAnchor" id="parameter-"></div> |
| 129 |
<b>state</b> |
| 130 |
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> |
| 131 |
<div style="font-size: small"> |
| 132 |
<span style="color: purple">string</span> |
| 133 |
</div> |
| 134 |
</td> |
| 135 |
<td> |
| 136 |
<ul style="margin: 0; padding: 0"><b>Choices:</b> |
| 137 |
<li><div style="color: blue"><b>merged</b> ←</div></li> |
| 138 |
<li>replaced</li> |
| 139 |
<li>overridden</li> |
| 140 |
<li>deleted</li> |
| 141 |
<li>gathered</li> |
| 142 |
<li>rendered</li> |
| 143 |
<li>parsed</li> |
| 144 |
</ul> |
| 145 |
</td> |
| 146 |
<td> |
| 147 |
<div>The state of the configuration after module completion</div> |
| 148 |
</td> |
| 149 |
</tr> |
| 150 |
</table> |
| 151 |
<br/> |
| 152 |
|
| 153 |
|
| 154 |
Notes |
| 155 |
----- |
| 156 |
|
| 157 |
.. note:: |
| 158 |
- Tested against NX-OS 7.0(3)I5(1). |
| 159 |
- Unsupported for Cisco MDS |
| 160 |
- Feature bfd should be enabled for this module. |
| 161 |
|
| 162 |
|
| 163 |
|
| 164 |
Examples |
| 165 |
-------- |
| 166 |
|
| 167 |
.. code-block:: yaml |
| 168 |
|
| 169 |
# Using deleted |
| 170 |
|
| 171 |
- name: Configure interfaces |
| 172 |
cisco.nxos.nxos_bfd_interfaces: |
| 173 |
state: deleted |
| 174 |
|
| 175 |
|
| 176 |
# Using merged |
| 177 |
|
| 178 |
- name: Configure interfaces |
| 179 |
cisco.nxos.nxos_bfd_interfaces: |
| 180 |
config: |
| 181 |
- name: Ethernet1/1 |
| 182 |
bfd: enable |
| 183 |
echo: enable |
| 184 |
- name: Ethernet1/2 |
| 185 |
bfd: disable |
| 186 |
echo: disable |
| 187 |
state: merged |
| 188 |
|
| 189 |
|
| 190 |
# Using overridden |
| 191 |
|
| 192 |
- name: Configure interfaces |
| 193 |
cisco.nxos.nxos_bfd_interfaces: |
| 194 |
config: |
| 195 |
- name: Ethernet1/1 |
| 196 |
bfd: enable |
| 197 |
echo: enable |
| 198 |
- name: Ethernet1/2 |
| 199 |
bfd: disable |
| 200 |
echo: disable |
| 201 |
state: overridden |
| 202 |
|
| 203 |
|
| 204 |
# Using replaced |
| 205 |
|
| 206 |
- name: Configure interfaces |
| 207 |
cisco.nxos.nxos_bfd_interfaces: |
| 208 |
config: |
| 209 |
- name: Ethernet1/1 |
| 210 |
bfd: enable |
| 211 |
echo: enable |
| 212 |
- name: Ethernet1/2 |
| 213 |
bfd: disable |
| 214 |
echo: disable |
| 215 |
state: replaced |
| 216 |
|
| 217 |
# Using rendered |
| 218 |
|
| 219 |
- name: Use rendered state to convert task input to device specific commands |
| 220 |
cisco.nxos.nxos_bfd_interfaces: |
| 221 |
config: |
| 222 |
- name: Ethernet1/800 |
| 223 |
bfd: enable |
| 224 |
echo: enable |
| 225 |
- name: Ethernet1/801 |
| 226 |
bfd: disable |
| 227 |
echo: disable |
| 228 |
state: rendered |
| 229 |
|
| 230 |
# Task Output (redacted) |
| 231 |
# ----------------------- |
| 232 |
|
| 233 |
# rendered: |
| 234 |
# - "interface Ethernet1/800" |
| 235 |
# - "bfd" |
| 236 |
# - "bfd echo" |
| 237 |
# - "interface Ethernet1/801" |
| 238 |
# - "no bfd" |
| 239 |
# - "no bfd echo" |
| 240 |
|
| 241 |
# Using parsed |
| 242 |
|
| 243 |
# parsed.cfg |
| 244 |
# ------------ |
| 245 |
|
| 246 |
# feature bfd |
| 247 |
# interface Ethernet1/800 |
| 248 |
# no switchport |
| 249 |
# no bfd |
| 250 |
# no bfd echo |
| 251 |
# interface Ethernet1/801 |
| 252 |
# no switchport |
| 253 |
# no bfd |
| 254 |
# interface Ethernet1/802 |
| 255 |
# no switchport |
| 256 |
# no bfd echo |
| 257 |
# interface mgmt0 |
| 258 |
# ip address dhcp |
| 259 |
# vrf member management |
| 260 |
|
| 261 |
- name: Use parsed state to convert externally supplied config to structured format |
| 262 |
cisco.nxos.nxos_bfd_interfaces: |
| 263 |
running_config: "{{ lookup('file', 'parsed.cfg') }}" |
| 264 |
state: parsed |
| 265 |
|
| 266 |
# Task output (redacted) |
| 267 |
# ----------------------- |
| 268 |
|
| 269 |
# parsed: |
| 270 |
# - bfd: disable |
| 271 |
# echo: disable |
| 272 |
# name: Ethernet1/800 |
| 273 |
# - bfd: disable |
| 274 |
# echo: enable |
| 275 |
# name: Ethernet1/801 |
| 276 |
# - bfd: enable |
| 277 |
# echo: disable |
| 278 |
# name: Ethernet1/802 |
| 279 |
# - bfd: enable |
| 280 |
# echo: enable |
| 281 |
# name: mgmt0 |
| 282 |
|
| 283 |
# Using gathered |
| 284 |
|
| 285 |
# Existing device config state |
| 286 |
# ------------------------------- |
| 287 |
|
| 288 |
# feature bfd |
| 289 |
# interface Ethernet1/1 |
| 290 |
# no switchport |
| 291 |
# no bfd |
| 292 |
# interface Ethernet1/2 |
| 293 |
# no switchport |
| 294 |
# no bfd echo |
| 295 |
# interface mgmt0 |
| 296 |
# ip address dhcp |
| 297 |
# vrf member management |
| 298 |
|
| 299 |
- name: Gather bfd_interfaces facts from the device using nxos_bfd_interfaces |
| 300 |
cisco.nxos.nxos_bfd_interfaces: |
| 301 |
state: gathered |
| 302 |
|
| 303 |
# Task output (redacted) |
| 304 |
# ----------------------- |
| 305 |
# gathered: |
| 306 |
# - name: Ethernet1/1 |
| 307 |
# bfd: disable |
| 308 |
# echo: enable |
| 309 |
# - name: Ethernet1/3 |
| 310 |
# echo: disable |
| 311 |
# bfd: enable |
| 312 |
# - name: mgmt0 |
| 313 |
# bfd: enable |
| 314 |
# echo: enable |
| 315 |
|
| 316 |
|
| 317 |
|
| 318 |
Return Values |
| 319 |
------------- |
| 320 |
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: |
| 321 |
|
| 322 |
.. raw:: html |
| 323 |
|
| 324 |
<table border=0 cellpadding=0 class="documentation-table"> |
| 325 |
<tr> |
| 326 |
<th colspan="1">Key</th> |
| 327 |
<th>Returned</th> |
| 328 |
<th width="100%">Description</th> |
| 329 |
</tr> |
| 330 |
<tr> |
| 331 |
<td colspan="1"> |
| 332 |
<div class="ansibleOptionAnchor" id="return-"></div> |
| 333 |
<b>after</b> |
| 334 |
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a> |
| 335 |
<div style="font-size: small"> |
| 336 |
<span style="color: purple">list</span> |
| 337 |
</div> |
| 338 |
</td> |
| 339 |
<td>when changed</td> |
| 340 |
<td> |
| 341 |
<div>The configuration as structured data after module completion.</div> |
| 342 |
<br/> |
| 343 |
<div style="font-size: smaller"><b>Sample:</b></div> |
| 344 |
<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 |
| 345 |
of the parameters above.</div> |
| 346 |
</td> |
| 347 |
</tr> |
| 348 |
<tr> |
| 349 |
<td colspan="1"> |
| 350 |
<div class="ansibleOptionAnchor" id="return-"></div> |
| 351 |
<b>before</b> |
| 352 |
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a> |
| 353 |
<div style="font-size: small"> |
| 354 |
<span style="color: purple">list</span> |
| 355 |
</div> |
| 356 |
</td> |
| 357 |
<td>always</td> |
| 358 |
<td> |
| 359 |
<div>The configuration as structured data prior to module invocation.</div> |
| 360 |
<br/> |
| 361 |
<div style="font-size: smaller"><b>Sample:</b></div> |
| 362 |
<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 |
| 363 |
of the parameters above.</div> |
| 364 |
</td> |
| 365 |
</tr> |
| 366 |
<tr> |
| 367 |
<td colspan="1"> |
| 368 |
<div class="ansibleOptionAnchor" id="return-"></div> |
| 369 |
<b>commands</b> |
| 370 |
<a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a> |
| 371 |
<div style="font-size: small"> |
| 372 |
<span style="color: purple">list</span> |
| 373 |
</div> |
| 374 |
</td> |
| 375 |
<td>always</td> |
| 376 |
<td> |
| 377 |
<div>The set of commands pushed to the remote device.</div> |
| 378 |
<br/> |
| 379 |
<div style="font-size: smaller"><b>Sample:</b></div> |
| 380 |
<div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">['interface Ethernet1/1', 'no bfd', 'no bfd echo']</div> |
| 381 |
</td> |
| 382 |
</tr> |
| 383 |
</table> |
| 384 |
<br/><br/> |
| 385 |
|
| 386 |
|
| 387 |
Status |
| 388 |
------ |
| 389 |
|
| 390 |
|
| 391 |
Authors |
| 392 |
~~~~~~~ |
| 393 |
|
| 394 |
- Chris Van Heuveln (@chrisvanheuveln) |