Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cisco.ios.ios_logging_global is not idempotent, but before/after is identical #904

Closed
cisco-abrandel opened this issue Aug 10, 2023 · 0 comments · Fixed by #940
Closed
Labels
logging_global logging_global resource module

Comments

@cisco-abrandel
Copy link

SUMMARY

When using the cisco.ios.ios_logging_global module, we've noticed that it is not idempotent for our configuration. Changed is set to true, but if you compare the before and after they appear identical.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

cisco.ios.ios_logging_global

ANSIBLE VERSION
ansible [core 2.15.2]
  config file = /Users/User/Desktop/git/network/ansible/ansible.cfg
  configured module search path = ['/Users/User/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/User/.pyenv/versions/3.11.0/lib/python3.11/site-packages/ansible
  ansible collection location = /Users/User/.ansible/collections:/usr/share/ansible/collections
  executable location = /Users/User/.pyenv/versions/3.11.0/bin/ansible
  python version = 3.11.0 (main, Nov  8 2022, 11:07:02) [Clang 14.0.0 (clang-1400.0.29.202)] (/Users/User/.pyenv/versions/3.11.0/bin/python3.11)
  jinja version = 3.1.2
  libyaml = True
COLLECTION VERSION
# /Users/User/.pyenv/versions/3.11.0/lib/python3.11/site-packages/ansible_collections
Collection Version
---------- -------
cisco.ios  4.6.1 
CONFIGURATION
CONFIG_FILE() = /Users/User/Desktop/git/network/ansible/ansible.cfg
DEFAULT_HOST_LIST(/Users/User/Desktop/git/network/ansible/ansible.cfg) = ['/Users/User/Desktop/git/network/ansible/inventory.yml']
DEFAULT_TIMEOUT(/Users/User/Desktop/git/network/ansible/ansible.cfg) = 10
EDITOR(env: EDITOR) = vim
HOST_KEY_CHECKING(/Users/User/Desktop/git/network/ansible/ansible.cfg) = False
PAGER(env: PAGER) = less
OS / ENVIRONMENT

Cisco IOS-XE 17.03.04a

STEPS TO REPRODUCE
  - name: Configure logging
    cisco.ios.ios_logging_global:
      config:
        buffered:
          severity: "{{ buffered_logging_level }}"
          size: "{{ logging_buffer_size }}"
        origin_id:
          tag: hostname
        hosts: "{{ ios_logging_hosts }}"
        userinfo: yes
        server_arp: yes
        source_interface:
          - interface: "{{ mgmt_source_interface }}"
            vrf: "{{ management_vrf|default(omit) }}"
    state: replaced
EXPECTED RESULTS

The module is idempotent when the before and after are identical

ACTUAL RESULTS
changed: [rtr-1] => {"after": {"buffered": {"severity": "informational", "size": 10000}, "origin_id": {"tag": "hostname"}, "server_arp": true, "source_interface": [{"interface": "GigabitEthernet0", "vrf": "Mgmt-intf"}], "userinfo": true}, "before": {"buffered": {"severity": "informational", "size": 10000}, "origin_id": {"tag": "hostname"}, "server_arp": true, "source_interface": [{"interface": "GigabitEthernet0", "vrf": "Mgmt-intf"}], "userinfo": true}, "changed": true, "commands": ["logging host 1.1.1.1 vrf Mgmt-intf transport udp port 1514", "logging host 2.2.2.2 vrf Mgmt-intf"]}

If I do a show run for the relevant config its trying to add, the config is already there:

show running-config | i logging host
logging host 1.1.1.1 vrf Mgmt-intf
logging host 2.2.2.2 vrf Mgmt-intf transport udp port 1514
@KB-perByte KB-perByte added the logging_global logging_global resource module label Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
logging_global logging_global resource module
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants