ansible-collections/cisco.ios

Wrong `group` and `user` ACL command in snmp_server

TheRealBecks opened this issue · 2 comments

SUMMARY

A wrong command gets generated for the SNMP group ACLs.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

snmp_server

ANSIBLE VERSION
ansible [core 2.16.1]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/mbeckert/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/mbeckert/.local/share/virtualenvs/ansible_collections-iEi87rjH/lib/python3.10/site-packages/ansible
  ansible collection location = /home/mbeckert/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/mbeckert/.local/share/virtualenvs/ansible_collections-iEi87rjH/bin/ansible
  python version = 3.10.13 (main, Aug 29 2023, 13:29:07) [GCC] (/home/mbeckert/.local/share/virtualenvs/ansible_collections-iEi87rjH/bin/python)
  jinja version = 3.1.2
  libyaml = True
COLLECTION VERSION

current git development version

CONFIGURATION
CONFIG_FILE() = /etc/ansible/ansible.cfg
EDITOR(env: EDITOR) = nano
PAGER(env: PAGER) = less
OS / ENVIRONMENT

Cisco IOS 15.2(2)E5

STEPS TO REPRODUCE
- name: SNMP test
  tags:
    - snmp_test
  cisco.ios.ios_snmp_server:
    state: "rendered"
    config:
      groups:
        - group: read-only-group
          version: v3
          version_option: priv
          read: read-all-view
          acl_v4: snmp-ipv4-acl
          acl_v6: snmp-ipv6-acl
EXPECTED RESULTS
snmp-server group read-only-group v3 priv read read-all-view access ipv6 snmp-ipv6-acl snmp-ipv4-acl
ACTUAL RESULTS

A wrong commands gets generated:

snmp-server group read-only-group v3 priv read read-all-view access snmp-ipv4-acl access ipv6 snmp-ipv6-acl

The parsing for the user is also wrong.

I created PR #994