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

[Bug]: snmptrap module can't process duplicate entries of snmp traps #461

Open
petetong1989 opened this issue Sep 25, 2024 · 0 comments
Open
Labels

Comments

@petetong1989
Copy link

Summary

When snmptrap module runs and try collecting the existing resources but failed into Found more than one resource with the same primary key which I don't think the primary key for snmptrap was set properly.
I reviewed our netscaler snmp trap configuration, and it is allowed to add multiple entires of snmp trap but the primary key isn't just trapdestination.

Issue Type

Bug Report

Component Name

snmptraps

Python Version

Python 3.10.14

Ansible Version

ansible [core 2.14.15]
  config file = /Users/pzhang/vscode/Project/network_ansible/ansible.cfg
  configured module search path = ['/Users/pzhang/vscode/Project/network_ansible/library/custom_modules/plugins/modules', '/Users/pzhang/vscode/Project/network_ansible/site-packages/citrix_sdx_ansible/modules']
  ansible python module location = /Users/pzhang/miniconda3/envs/network_ansible/lib/python3.10/site-packages/ansible
  ansible collection location = /Users/pzhang/vscode/Project/network_ansible/site-packages
  executable location = /Users/pzhang/miniconda3/envs/network_ansible/bin/ansible
  python version = 3.10.14 (main, Mar 21 2024, 11:24:58) [Clang 14.0.6 ] (/Users/pzhang/miniconda3/envs/network_ansible/bin/python)
  jinja version = 3.0.0
  libyaml = True

Ansible Configuration

$ ansible-config dump --only-changed

netscaler.adc Collection Version

# /Users/pzhang/vscode/Project/network_ansible/site-packages/ansible_collections
Collection    Version
------------- -------
netscaler.adc 2.6.1

Target NetScaler Version

> show ns version

Equivalent NetScaler CLI Command

Steps to Reproduce

- name: "Set SNMP Traps"
  delegate_to: localhost
  netscaler.adc.snmptrap:
    nsip: "{{ (deployment == 'cluster') | ternary(clip, mgmt_ip) }}"
    state: "{{ item.state | default('present') }}"
    validate_certs: false
    nitro_user: "{{ ansible_user }}"
    nitro_pass: "{{ ansible_ssh_pass }}"
    communityname: "{{ item.communityname }}"
    trapclass: "{{ item.trapclass }}"
    trapdestination: "{{ item.trapdestination }}"
  when: primary_configurable_node
  loop: "{{ snmp_traps }}"
  loop_control:
    label: "{{ 'snmp-trap/' ~ item.trapdestination }}"
  tags:
    - snmpSetting
    - clusterNodeSetting
    - haNodeSetting

Expected Results

I expected snmptrap would be smarter not just using trapdestination as the primary key.

Actual Results

Additional Notes

No response

@petetong1989 petetong1989 closed this as not planned Won't fix, can't repro, duplicate, stale Sep 25, 2024
@petetong1989 petetong1989 reopened this Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant