Update acl_facts to render data correctly #519
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SUMMARY
Resource module cisco.iosxr.iosxr_acls returned facts are not rendered accurately for some acl entries.
ansible_facts returned included the acl matches on an entry as well, instead of just the entry parameters. Issue seems to be in: https://github.com/ansible-collections/cisco.iosxr/blob/main/plugins/module_utils/network/iosxr/facts/acls/acls.py
Tested on Ansible 2.15.8. When applying the data from facts to a host device, it errors on the device with the following error message:
TASK [Configure ACLs] **************************************************************
{
"module_stdout": "",
"module_stderr": "60 deny ipv4 10.0.0.0 0.255.255.255 any (1 match)\r\n\r ^\r\n% Invalid input detected at '^' marker.\r\nRP/0/RP0/CPU0:BRCELG51(config-ipv4-acl)#",
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
"_ansible_no_log": false,
"changed": false
}
Fixes: ANA-525
ISSUE TYPE
COMPONENT NAME
cisco.iosxr.iosxr_acls
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
cisco IOSXR MODEL: cisco 8201-32FH
"ansible_net_system": "iosxr",
"ansible_net_model": "8000 Series",
"ansible_net_version": "7.7.2 LNT",
yeti_network_services:
aces:
state: append
grant: permit
protocol: ip
source:
any: true
destination:
prefix: x.x.x.x/y
state: replaced
cisco.iosxr.iosxr_acls:
config: "{{ network_service_config['acls'] }}"
state: "{{ network_service_config['state'] }}"
register: acls_config
closed in : #521