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

ios_logging_global: command order when setting discriminator #935

Closed
eleksis opened this issue Sep 28, 2023 · 0 comments · Fixed by #940
Closed

ios_logging_global: command order when setting discriminator #935

eleksis opened this issue Sep 28, 2023 · 0 comments · Fixed by #940
Assignees
Labels
logging_global logging_global resource module

Comments

@eleksis
Copy link
Contributor

eleksis commented Sep 28, 2023

SUMMARY

Module does not respect command order when using discriminator.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

ios_logging_global.py

ANSIBLE VERSION
ansible [core 2.12.5]
COLLECTION VERSION
Collection Version
---------- -------
cisco.ios  4.6.1  
CONFIGURATION

OS / ENVIRONMENT

Tested on Cisco 9000 series

STEPS TO REPRODUCE

On device no logging is set.

no logging buffered
no logging console
no logging monitor
    - name: Apply logging configuration
      cisco.ios.ios_logging_global:
        config:
          logging_on: enable
          discriminator:
            - DROP mnemonics drops ACCESSLOG
          buffered:
            discriminator: DROP
            size: 262144
            severity: debugging
        state: replaced
EXPECTED RESULTS

I expect module to generate commands in right order. Discriminator has to be set first, only then it can be used for logging destinations.

ACTUAL RESULTS

Module crashes.

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: sarbor(config)#
fatal: [switch.example.com]: FAILED! => changed=false 
  module_stderr: |-
    Traceback (most recent call last):
      File "/home/user/.ansible/tmp/ansible-local-2178647y7slcfkt/ansible-tmp-1695886947.6903086-2178719-217697039104943/AnsiballZ_ios_logging_global.py", line 107, in <module>
        _ansiballz_main()
      File "/home/user/.ansible/tmp/ansible-local-2178647y7slcfkt/ansible-tmp-1695886947.6903086-2178719-217697039104943/AnsiballZ_ios_logging_global.py", line 99, in _ansiballz_main
        invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
      File "/home/user/.ansible/tmp/ansible-local-2178647y7slcfkt/ansible-tmp-1695886947.6903086-2178719-217697039104943/AnsiballZ_ios_logging_global.py", line 47, in invoke_module
        runpy.run_module(mod_name='ansible_collections.cisco.ios.plugins.modules.ios_logging_global', init_globals=dict(_module_fqn='ansible_collections.cisco.ios.plugins.modules.ios_logging_global', _modlib_path=modlib_path),
      File "/usr/lib/python3.9/runpy.py", line 210, in run_module
        return _run_module_code(code, init_globals, run_name, mod_spec)
      File "/usr/lib/python3.9/runpy.py", line 97, in _run_module_code
        _run_code(code, mod_globals, init_globals,
      File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
        exec(code, run_globals)
      File "/tmp/ansible_cisco.ios.ios_logging_global_payload_j6w7z3h2/ansible_cisco.ios.ios_logging_global_payload.zip/ansible_collections/cisco/ios/plugins/modules/ios_logging_global.py", line 1084, in <module>
      File "/tmp/ansible_cisco.ios.ios_logging_global_payload_j6w7z3h2/ansible_cisco.ios.ios_logging_global_payload.zip/ansible_collections/cisco/ios/plugins/modules/ios_logging_global.py", line 1079, in main
      File "/tmp/ansible_cisco.ios.ios_logging_global_payload_j6w7z3h2/ansible_cisco.ios.ios_logging_global_payload.zip/ansible_collections/cisco/ios/plugins/module_utils/network/ios/config/logging_global/logging_global.py", line 86, in execute_module
      File "/tmp/ansible_cisco.ios.ios_logging_global_payload_j6w7z3h2/ansible_cisco.ios.ios_logging_global_payload.zip/ansible_collections/ansible/netcommon/plugins/module_utils/network/common/rm_base/resource_module.py", line 174, in run_commands
      File "/tmp/ansible_cisco.ios.ios_logging_global_payload_j6w7z3h2/ansible_cisco.ios.ios_logging_global_payload.zip/ansible/module_utils/connection.py", line 200, in __rpc__
    ansible.module_utils.connection.ConnectionError: logging buffered discriminator DROP 262144 debugging
    Specified MD by the name DROP is not found.
  
    switch(config)#
  module_stdout: ''
  msg: |-
    MODULE FAILURE
    See stdout/stderr for the exact error
  rc: 1
@KB-perByte KB-perByte self-assigned this Oct 4, 2023
@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