ansible-collections / cisco.ios

Ansible Network Collection for Cisco IOS
GNU General Public License v3.0
283 stars 169 forks source link

Cisco.ios.ios_l3_interfaces dhcp and autoconfig parameters don’t operate as documented #697

Closed digitalfiend64 closed 1 year ago

digitalfiend64 commented 1 year ago
SUMMARY

Cisco.ios.ios_l3_interfaces dhcp and autoconfig parameters don’t operate as documented. When using an inventory with dhcp: { enabled: false } the dhcp config of the interface does not get removed. This same behavior occurs with the autoconfig parameter. However, when running the same inventory and changing the value of the key to true both dhcp and autoconfig get added to the interface if it wasn’t previously configured on it.

ISSUE TYPE
COMPONENT NAME

Cisco.ios.ios_l3_interfaces v4.0.0

ANSIBLE VERSION

Ansible v2.9.27

COLLECTION VERSION
# /usr/local/lib/python3.8/site-packages/ansible_collections
Collection Version
---------- -------
cisco.ios  2.8.1

# /home/<username>/.ansible/collections/ansible_collections
Collection Version
---------- -------
cisco.ios  4.0.0
CONFIGURATION
DEFAULT_LOAD_CALLBACK_PLUGINS(/home/<username>/.ansible.cfg) = True
DEFAULT_STDOUT_CALLBACK(/home/<username>/.ansible.cfg) = yaml
DEFAULT_TIMEOUT(/home/<username>/.ansible.cfg) = 120
DEPRECATION_WARNINGS(/home/<username>/.ansible.cfg) = False
GALAXY_IGNORE_CERTS(/home/<username>/.ansible.cfg) = True
GALAXY_SERVER_LIST(/home/<username>/.ansible.cfg) = ['inbound_yeti_repo', 'published_repo', 'rh-certified_repo']
HOST_KEY_CHECKING(/home/<username>/.ansible.cfg) = False
PARAMIKO_HOST_KEY_AUTO_ADD(/home/<username>/.ansible.cfg) = True
PERSISTENT_COMMAND_TIMEOUT(/home/<username>/.ansible.cfg) = 300
PERSISTENT_CONNECT_TIMEOUT(/home/<username>/.ansible.cfg) = 120
RETRY_FILES_ENABLED(/home/<username>/.ansible.cfg) = False
OS / ENVIRONMENT

Cisco IOS Software, Catalyst 4500 L3 Switch Software (cat4500e-ENTSERVICESK9-M), Version 15.2(4)E2, RELEASE SOFTWARE (fc2)

STEPS TO REPRODUCE
  1. Run the Update l3_interfaces No DHCP/Autoconfig task
  2. Run the same task again
    - name: Update l3_interfaces
      cisco.ios.ios_l3_interfaces:
      config:
      - name: Vlan51
        ipv6:
        - address: 2001::abcd:abcd:abcd:abcd/64
          anycast: false
          autoconfig:
            default: false
            enable: false
          cga: false
          dhcp:
            enable: false
            rapid_commit: false
          eui: false
          link_local: false
      state: merged
EXPECTED RESULTS

Step #1 should not configure DHCP and Autoconfig under the interface. Step #2 should not fail

ACTUAL RESULTS

Step #1 configures DHCP and Autoconfig under the interface Step #2 will fail the task

DHCP and Autoconfig are enabled and if run again you get “msg: address format is /, got invalid format dhcp”.

fatal: [hostname]: FAILED! => changed=false
  invocation:
    module_args:
      config:
      - ipv4:
        - address: 192.168.1.3/31
          dhcp:
            client_id: null
            enable: false
            hostname: some_string
          dhcp_client: null
          dhcp_hostname: null
          pool: some_string
          secondary: true
        ipv6: null
        name: Vlan50
      - ipv4: null
        ipv6:
        - address: 2001::abcd:abcd:abcd:abcd/64
          anycast: false
          autoconfig:
            default: false
            enable: false
          cga: false
          dhcp:
            enable: false
            rapid_commit: false
          eui: false
          link_local: false
          segment_routing: null
        name: Vlan51
      running_config: null
      state: merged
  msg: address format is <ipv6 address>/<mask>, got invalid format dhcp
digitalfiend64 commented 1 year ago

Dear maintainer, I see this was fixed in merge https://github.com/ansible-collections/cisco.ios/pull/700 but I do not see this issue or merge https://github.com/ansible-collections/cisco.ios/pull/700 in the latest *changelog. What collection version should this be resolved in?

*) Changelog Referenced: https://github.com/ansible-collections/cisco.ios/blob/main/changelogs/changelog.yaml