aruba / aoscx-ansible-collection

Ansible collections for AOS-CX switches 
48 stars 23 forks source link

aoscx_acl fault with icmp-type - values in post body not configurable #106

Open git4m opened 7 months ago

git4m commented 7 months ago

Hi,

tested with latest aoscx collection version and latest pyaoscx:

 - name: Add ACL task (AOSCX)
      tags: [ "task_acl2" ]
      arubanetworks.aoscx.aoscx_acl:
        name: test_acl2
        type: ipv4
        state: update
        acl_entries:
          60: 
            action: permit
            protocol: icmp
            icmp-type: echo-reply

This should produce an acl with 60 permit icmp any any icmp-type echo-reply

IT should be supported according to: https://github.com/aruba/aoscx-ansible-collection/blob/93159019f022c844f65d929a61b35cba6fd11fb0/plugins/modules/aoscx_acl.py#L246

The full traceback is:
  File "/tmp/ansible_arubanetworks.aoscx.aoscx_acl_payload_0f6qwuiw/ansible_arubanetworks.aoscx.aoscx_acl_payload.zip/ansible_collections/arubanetworks/aoscx/plugins/modules/aoscx_acl.py", line 638, in main
  File "/home/user/proj/network-automation/.venv/lib/python3.9/site-packages/pyaoscx/pyaoscx_module.py", line 40, in ensure_connected
    return fnct(self, *args, **kwargs)
  File "/home/user/proj/network-automation/.venv/lib/python3.9/site-packages/pyaoscx/acl_entry.py", line 408, in apply
    modified = self.create()
  File "/home/user/proj/network-automation/.venv/lib/python3.9/site-packages/pyaoscx/pyaoscx_module.py", line 40, in ensure_connected
    return fnct(self, *args, **kwargs)
  File "/home/user/proj/network-automation/.venv/lib/python3.9/site-packages/pyaoscx/acl_entry.py", line 538, in create
    raise GenericOperationError(response.text, response.status_code)
fatal: [SWITCH]: FAILED! => changed=false
  invocation:
    module_args:
      acl_entries:
        '60':
          action: permit
          icmp-type: echo-reply
          protocol: icmp
      name: test_acl2
      state: update
      type: ipv4
  msg: '''GENERIC OPERATION ERROR: values in post body not configurable\n: Code: 400'''
tchiapuziowong commented 5 months ago

Thank you @git4m for bringing this to our attention, I'll create a ticket and will update the issue when progress is made!