Default values are also added part of user input in ansible resource modules, is this bug or by design?

8 views
Skip to first unread message

Mohamed Javeed

unread,
Jun 6, 2020, 6:48:13 AM6/6/20
to Ansible Project

Hi All,


Default values are also added part of user input in ansible resource modules, is this bug or by design?


Below is the configuration available in switch:

          - nameEthernet28

            access

              vlan11

            trunk

                - vlan12

                - vlan13

 

 

Delete all allowed VLANs NOT access VLAN:

 

    - name"Delete all allowed VLANs NOT access VLAN"

      sonic_l2_interfaces:

        config:

          - nameEthernet28

            trunk

        statedeleted

 

Inside the module,

but expected want variable data inside the module coming as below:

          - nameEthernet28

            trunk: null


but actual want variable data inside the module coming as below: because both the values are coming as null, in module there is no way to differentiate whats the user input that needs to be deleted?

          - nameEthernet28

            access: null

            trunk: null

 

 

is this a bug or as per design?


These default values are added at https://github.com/ansible/ansible/blob/stable-2.9/lib/ansible/module_utils/basic.py#L1837


if this is by design, how to delete only access or trunk VLANs?

 

Thanks

Mohamed Javeed

Reply all
Reply to author
Forward
0 new messages