Closed git4m closed 7 months ago
I just ran into this today. If you enable debug logging, it throws a pyaoscx error, so it could be an issue with that package. I've only used it through ansible though, so I don't think I have enough info to create an issue in that project right now.
The full traceback is:
File "/tmp/ansible_arubanetworks.aoscx.aoscx_acl_payload_1ubsryud/ansible_arubanetworks.aoscx.aoscx_acl_payload.zip/ansible_collections/arubanetworks/aoscx/plugins/modules/aoscx_acl.py", line 614, in main
File "/home/user/ansible-venv/lib/python3.10/site-packages/pyaoscx/pyaoscx_module.py", line 40, in ensure_connected
return fnct(self, *args, **kwargs)
File "/home/user/ansible-venv/lib/python3.10/site-packages/pyaoscx/acl_entry.py", line 278, in apply
self._extract_missing_parameters_from(remote_ace)
File "/home/user/ansible-venv/lib/python3.10/site-packages/pyaoscx/pyaoscx_module.py", line 342, in _extract_missing_parameters_from
setattr(self, param_name, deepcopy(param))
File "/home/user/ansible-venv/lib/python3.10/site-packages/pyaoscx/acl_entry.py", line 651, in dst_ip
version = utils.get_ip_version(new_dst_ip)
File "/home/user/ansible-venv/lib/python3.10/site-packages/pyaoscx/utils/util.py", line 329, in get_ip_version
raise ParameterError(msg)
fatal: [wo033-cx6200-stack]: FAILED! => changed=false
invocation:
module_args:
acl_entries:
'10':
action: permit
comment: xxxxx
src_ip: 10.10.10.10/32
name: MGMT
state: create
type: ipv4
msg: '''PARAMETER ERROR: Invalid IP: None does not appear to be an IPv4 or IPv6 interface'''
Coming from https://github.com/aruba/pyaoscx/blob/aa91f087304859124f8a2fd91b7cbe1981c306a0/pyaoscx/utils/util.py#L328 i think
May be need to replace 10.10.10.10/32 to 10.10.10.10 ? (i known on this case the doc is wrong!
The problem is the same, regardless if specified with /32 mask or without.
Please note, that the running config shown below was successfully created via ansible-playbook:
access-list ip test_acl
1 comment Deny the host
1 deny tcp 158.10.12.57/32 any count
Running below task leads to the error:
- name: Add ACL task 1 (AOSCX)
arubanetworks.aoscx.aoscx_acl:
name: test_acl
type: ipv4
state: update
acl_entries:
1:
comment: "Deny the host"
action: permit
count: true
src_ip: 158.10.12.57
protocol: tcp
leads as well to the same error. The full traceback is:
File "/tmp/ansible_arubanetworks.aoscx.aoscx_acl_payload_x1z50ukn/ansible_arubanetworks.aoscx.aoscx_acl_payload.zip/ansible_collections/arubanetworks/aoscx/plugins/modules/aoscx_acl.py", line 614, 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 278, in apply
self._extract_missing_parameters_from(remote_ace)
File "/home/user/proj/network-automation/.venv/lib/python3.9/site-packages/pyaoscx/pyaoscx_module.py", line 342, in _extract_missing_parameters_from
setattr(self, param_name, deepcopy(param))
File "/home/user/proj/network-automation/.venv/lib/python3.9/site-packages/pyaoscx/acl_entry.py", line 651, in dst_ip
version = utils.get_ip_version(new_dst_ip)
File "/home/user/proj/network-automation/.venv/lib/python3.9/site-packages/pyaoscx/utils/util.py", line 329, in get_ip_version
raise ParameterError(msg)
fatal: [switch]: FAILED! => changed=false
invocation:
module_args:
acl_entries:
'1':
action: permit
comment: Deny the host
count: true
protocol: 6
src_ip: 158.10.12.57
name: test_acl
state: update
type: ipv4
msg: '''PARAMETER ERROR: Invalid IP: None does not appear to be an IPv4 or IPv6 interface'''
i think, it is a bug on pyaoscx (coming from this change https://github.com/aruba/pyaoscx/commit/225d937186d0bb6686ed2426c8e7c8e3c69b77e3#diff-246653dbf6112e85b21c32b5243dbe2ece1d77308690ca19d820176d6e465765R325
@tchiapuziowong @rajani-abraham
@git4m @alagoutte thank you for bringing this to our attention, we're investigating and developing a fix for this and will update the issue once the patch is published
Any update on this one? - I'm also hitting the same error.
TASK [allow AWX in mgmt acl] ***************************************************
fatal: [test6100]: FAILED! => {"changed": false, "msg": "'PARAMETER ERROR: Invalid IP: None does not appear to be an IPv4 or IPv6 interface'"}
- name: allow AWX in mgmt acl
aoscx_acl:
name: acl_test
type: ipv4
acl_entries:
28:
comment: test line
action: permit
src_ip: 10.0.0.1/32
protocol: tcp
dst_l4_port: 22
Same error if I try without the mask.
Any update on this one? - I'm also hitting the same error.
TASK [allow AWX in mgmt acl] *************************************************** fatal: [test6100]: FAILED! => {"changed": false, "msg": "'PARAMETER ERROR: Invalid IP: None does not appear to be an IPv4 or IPv6 interface'"}
- name: allow AWX in mgmt acl aoscx_acl: name: acl_test type: ipv4 acl_entries: 28: comment: test line action: permit src_ip: 10.0.0.1/32 protocol: tcp dst_l4_port: 22
Same error if I try without the mask.
can you try v4.4.0 ? (and don't forget to upgrade also pyaoscx!)
Hi @tchiapuziowong
Thank you for providing the v 4.4.0 fix. It has fixed above issue.
I found another issues with aoscx_acl and icmp-type, going to create a new issue.
Fault in aoscx_acl module when trying to update an existing acl.
Switch: 6300M Firmware: 10.10.1060
running-config:
Task in playbook. Note: we are planning to update the acl action from "deny" to "permit" and update the comment:
Playbook output:
Ansible collection:
Python modules: