Skip to content

Commit aa24ec7

Browse files
committed
Update documentation to include skip_validation.
1. Add an example with skip_validation set to true. 2. Add an example that generates a misleading error message and explain how to interpret the message.
1 parent 72ac05b commit aa24ec7

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

plugins/modules/dcnm_fabric.py

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2574,6 +2574,27 @@
25742574
- debug:
25752575
var: result
25762576
2577+
# Setting skip_validation to True to bypass parameter validation in the module.
2578+
# Note, this does not bypass parameter validation in NDFC. skip_validation
2579+
# can be useful to verify that the dcnm_fabric module's parameter validation
2580+
# is disallowing parameter combinations that would also be disallowed by
2581+
# NDFC.
2582+
2583+
- name: Update fabrics
2584+
cisco.dcnm.dcnm_fabric:
2585+
state: merged
2586+
skip_validation: True
2587+
config:
2588+
- FABRIC_NAME: VXLAN_Fabric
2589+
FABRIC_TYPE: VXLAN_EVPN
2590+
BGP_AS: 65000
2591+
ANYCAST_GW_MAC: 0001.aabb.ccdd
2592+
UNDERLAY_IS_V6: false
2593+
EXTRA_CONF_LEAF: |
2594+
interface Ethernet1/1-16
2595+
description managed by NDFC
2596+
DEPLOY: false
2597+
25772598
# Use replaced state to return the fabrics to their default configurations.
25782599
25792600
- name: Return fabrics to default configuration.
@@ -2620,6 +2641,31 @@
26202641
- debug:
26212642
var: result
26222643
2644+
# When skip_validation is False (the default), some error messages might be
2645+
# misleading. For example, with the playbook below, the error message
2646+
# that follows should be interpreted as "ENABLE_PVLAN is mutually-exclusive
2647+
# to ENABLE_SGT and should be removed from the playbook if ENABLE_SGT is set
2648+
# to True." In the NDFC GUI, if Security Groups is enabled, NDFC disables
2649+
# the ability to modify the PVLAN option. Hence, even a valid value for
2650+
# ENABLE_PVLAN in the playbook will generate an error.
2651+
2652+
```bash
2653+
fatal: [ndfc1]: FAILED! => {"changed": false, "msg": "The following parameter(value) combination(s) are invalid and need to be reviewed: Fabric: f3, ENABLE_PVLAN(False) requires ENABLE_SGT != True. ENABLE_SGT valid values: [False, True]. ", "response": [{}], "result": [{}]}
2654+
```
2655+
2656+
```yaml
2657+
- name: merged fabrics (dcnm_send)
2658+
cisco.dcnm.dcnm_fabric:
2659+
state: merged
2660+
skip_validation: false
2661+
config:
2662+
- FABRIC_NAME: MyFabric
2663+
FABRIC_TYPE: VXLAN_EVPN
2664+
BGP_AS: 65001
2665+
ENABLE_SGT: true
2666+
ENABLE_PVLAN: false
2667+
```
2668+
26232669
"""
26242670
# pylint: disable=wrong-import-position
26252671
import copy

0 commit comments

Comments
 (0)