cisco.ios icon indicating copy to clipboard operation
cisco.ios copied to clipboard

cisco.ios.ios_config IPv6 bug

Open brunopeter opened this issue 11 months ago • 1 comments

SUMMARY

Unable to update configuration when using IPv6 addresses. Confirmed issue occurs with both "ipv6 address" and "ipv6 dhcp relay destination" commands. Idempotency warning are triggered the first time commands are run on cisco switch. Commands are accepted and show in running config.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

cisco.ios.ios_config

ANSIBLE VERSION
ansible --version
ansible [core 2.14.9]
  config file = /home/peterb/ansible/ansible.cfg
  configured module search path = ['/home/peterb/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  ansible collection location = /home/peterb/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.11.6 (main, Oct  8 2023, 05:06:43) [GCC 13.2.0] (/usr/bin/python3)
  jinja version = 3.1.2
  libyaml = True
COLLECTION VERSION
Collection                    Version
----------------------------- -------
ansible.netcommon             4.1.0  
ansible.utils                 2.10.3 
cisco.ios                     4.6.1  
CONFIGURATION
OS / ENVIRONMENT

Verified against: Cisco IOS Software, IOS-XE Software, Catalyst 4500 L3 Switch Software (cat4500es8-UNIVERSALK9-M), Version 03.11.08.E RELEASE SOFTWARE (fc1)

Cisco IOS Software, C3560CX Software (C3560CX-UNIVERSALK9-M), Version 15.2(7)E9, RELEASE SOFTWARE (fc1)

STEPS TO REPRODUCE
- name: "Update interface"
cisco.ios.ios_config:
lines:
- "ip helper-address 192.168.1.1"
- "ip helper-address 192.168.2.2"
- "ipv6 dhcp relay destination 2001::1"
parents:
"interface Vlan99"
EXPECTED RESULTS

Vlan interface updated with IPv6 relay address(s).

ACTUAL RESULTS

Idempotency is always triggered on first run. Completes successfully on subsequent runs but changed is not triggered and configuration not saved though present in running.

ANSIBLE_NETWORK_IMPORT_MODULES: Result: {'changed': True, 'warnings': ['To ensure idempotency and correct diff the input configuration lines should be similar to how they appear if present in the running configuration on device'], 'commands': ['interface Vlan99', 'ipv6 dhcp relay destination 2001::1'], 'updates': ['interface Vlan99', 'ipv6 dhcp relay destination 2001::1'], 'banners': {}, 'invocation': {'module_args': {'lines': ['ip helper-address [192.168.1.1](https://192.168.1.1/)', 'ip helper-address [192.168.2.2](https://192.168.2.2/)', 'ipv6 dhcp relay destination 2001::1'], 'parents': ['interface Vlan99'], 'match': 'line', 'replace': 'line', 'multiline_delimiter': '@', 'defaults': False, 'backup': False, 'save_when': 'never', 'src': None, 'before': None, 'after': None, 'running_config': None, 'intended_config': None, 'backup_options': None, 'diff_against': None, 'diff_ignore_lines': None}}, '_ansible_parsed': True}

[WARNING]: To ensure idempotency and correct diff the input configuration lines should be similar to how they appear if present in the running configuration on device

brunopeter avatar Mar 28 '24 19:03 brunopeter

It would appear that the same thing is now happening with 'ip helper-address' commands since updating to the latest collection (6.1.4).

- name: "Update interfaces DHCP"
  cisco.ios.ios_config:
    lines:
      - ip helper-address 192.168.1.1
      - ip helper-address 192.168.2.2
    parents: 
      interface Vlan99
"msg": [
        "-----STEP-1-----------------------------------------------",
        {
            "banners": {},
            "changed": true,
            "commands": [
                "interface Vlan99",
                "ip helper-address 192.168.1.1",
                "ip helper-address 192.168.2.2"
            ],
            "failed": false,
            "updates": [
                "interface Vlan99",
                "ip helper-address 192.168.1.1",
                "ip helper-address 192.168.2.2"
            ],
            "warnings": [
                "To ensure idempotency and correct diff the input configuration lines should be similar to how they appear if present in the running configuration on device"
            ]
        }
    ]
}

brunopeter avatar Mar 29 '24 18:03 brunopeter