ansible-collections / cisco.ios

Ansible Network Collection for Cisco IOS
GNU General Public License v3.0
293 stars 171 forks source link

failure in gathered a Extended IP access list with object-group #339

Closed lbrines closed 3 years ago

lbrines commented 3 years ago
SUMMARY
ISSUE TYPE
COMPONENT NAME
ANSIBLE VERSION
ansible 2.9.6
config file = /root/ansible_networking/ansible.cfg
configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3/dist-packages/ansible
executable location = /usr/bin/ansible
python version = 3.8.5 (default, Jan 27 2021, 15:41:15) [GCC 9.3.0]
CONFIGURATION
ACTION_WARNINGS(/root/ansible_networking/ansible.cfg) = False
DEFAULT_HOST_LIST(/root/ansible_networking/ansible.cfg) = ['/root/ansible_networking/hosts']
DEFAULT_TIMEOUT(/root/ansible_networking/ansible.cfg) = 5
DEPRECATION_WARNINGS(/root/ansible_networking/ansible.cfg) = False
HOST_KEY_CHECKING(/root/ansible_networking/ansible.cfg) = False
OS / ENVIRONMENT

OS: Linux NetworkAutomation-1 5.4.0-52-generic #57~18.04.1-Ubuntu SMP Thu Oct 15 14:04:49 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Cisco ROM: ROMMON Emulation Microcode BOOTLDR: 7200 Software (C7200-ADVENTERPRISEK9-M), Version 15.2(4)M7, RELEASE SOFTWARE (fc2)

Environment: GNS3

STEPS TO REPRODUCE

when executing with only standard access lists it works fine, but when including ip extended access lists, terminal to execute with error

access-lists

R1# sh access-lists
Standard IP access list 10
     10 permit 192.168.88.50
Extended IP access list 110
     10 permit ip object-group my_obj any
---
- name: convert configured ACLs to structured data
  hosts: all
  gather_facts: false
  tasks:

  - name: Use the ACLs resource module to gather the current config
    cisco.ios.ios_acls:
      config:
      state: gathered
EXPECTED RESULTS
ACTUAL RESULTS
ansible-playbook 2.9.6
  config file = /root/ansible_networking/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  executable location = /usr/bin/ansible-playbook
  python version = 3.8.5 (default, Jan 27 2021, 15:41:15) [GCC 9.3.0]
Using /root/ansible_networking/ansible.cfg as config file
host_list declined parsing /root/ansible_networking/hosts as it did not pass its verify_file() method
script declined parsing /root/ansible_networking/hosts as it did not pass its verify_file() method
auto declined parsing /root/ansible_networking/hosts as it did not pass its verify_file() method
Parsed /root/ansible_networking/hosts inventory source with ini plugin

PLAYBOOK: acl.yaml **********************************************************************************************************************************
1 plays in acl.yaml

PLAY [convert configured ACLs to structured data] ***************************************************************************************************
META: ran handlers

TASK [Use the ACLs resource module to gather the current config] ************************************************************************************
task path: /root/ansible_networking/acl.yaml:8
<router1> ESTABLISH LOCAL CONNECTION FOR USER: root
<router1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /root/.ansible/tmp/ansible-local-7610e6f9630s/ansible-tmp-1622374470.60001-102926243935224 `" && echo ansible-tmp-1622374470.60001-102926243935224="` echo /root/.ansible/tmp/ansible-local-7610e6f9630s/ansible-tmp-1622374470.60001-102926243935224 `" ) && sleep 0'
<router1> Attempting python interpreter discovery
<router1> EXEC /bin/sh -c 'echo PLATFORM; uname; echo FOUND; command -v '"'"'/usr/bin/python'"'"'; command -v '"'"'python3.7'"'"'; command -v '"'"'python3.6'"'"'; command -v '"'"'python3.5'"'"'; command -v '"'"'python2.7'"'"'; command -v '"'"'python2.6'"'"'; command -v '"'"'/usr/libexec/platform-python'"'"'; command -v '"'"'/usr/bin/python3'"'"'; command -v '"'"'python'"'"'; echo ENDFOUND && sleep 0'
<router1> EXEC /bin/sh -c '/usr/bin/python3 && sleep 0'
Using module file /root/.ansible/collections/ansible_collections/cisco/ios/plugins/modules/ios_acls.py
<router1> PUT /root/.ansible/tmp/ansible-local-7610e6f9630s/tmp_itoifcj TO /root/.ansible/tmp/ansible-local-7610e6f9630s/ansible-tmp-1622374470.60001-102926243935224/AnsiballZ_ios_acls.py
<router1> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-local-7610e6f9630s/ansible-tmp-1622374470.60001-102926243935224/ /root/.ansible/tmp/ansible-local-7610e6f9630s/ansible-tmp-1622374470.60001-102926243935224/AnsiballZ_ios_acls.py && sleep 0'
<router1> EXEC /bin/sh -c '/usr/bin/python3 /root/.ansible/tmp/ansible-local-7610e6f9630s/ansible-tmp-1622374470.60001-102926243935224/AnsiballZ_ios_acls.py && sleep 0'
<router1> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-local-7610e6f9630s/ansible-tmp-1622374470.60001-102926243935224/ > /dev/null 2>&1 && sleep 0'
fatal: [router1]: FAILED! => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python3"
    },
    "changed": false,
    "invocation": {
        "module_args": {
            "config": [
                {
                    "acls": [
                        {
                            "aces": [
                                {
                                    "destination": {
                                        "address": null,
                                        "any": null,
                                        "host": null,
                                        "port_protocol": {
                                            "eq": null,
                                            "gt": null,
                                            "lt": null,
                                            "neq": null,
                                            "range": null
                                        },
                                        "wildcard_bits": null
                                    },
                                    "dscp": null,
                                    "evaluate": null,
                                    "fragments": null,
                                    "grant": "permit",
                                    "log": {
                                        "set": null,
                                        "user_cookie": null
                                    },
                                    "log_input": {
                                        "set": null,
                                        "user_cookie": null
                                    },
                                    "option": {
                                        "add_ext": null,
                                        "any_options": null,
                                        "com_security": null,
                                        "dps": null,
                                        "encode": null,
                                        "eool": null,
                                        "ext_ip": null,
                                        "ext_security": null,
                                        "finn": null,
                                        "imitd": null,
                                        "lsr": null,
                                        "mtup": null,
                                        "mtur": null,
                                        "no_op": null,
                                        "nsapa": null,
                                        "record_route": null,
                                        "router_alert": null,
                                        "sdb": null,
                                        "security": null,
                                        "ssr": null,
                                        "stream_id": null,
                                        "timestamp": null,
                                        "traceroute": null,
                                        "ump": null,
                                        "visa": null,
                                        "zsu": null
                                    },
                                    "precedence": null,
                                    "protocol": null,
                                    "protocol_options": null,
                                    "sequence": 10,
                                    "source": {
                                        "address": "192.168.88.50",
                                        "any": null,
                                        "host": null,
                                        "port_protocol": null,
                                        "wildcard_bits": null
                                    },
                                    "time_range": null,
                                    "tos": {
                                        "max_reliability": null,
                                        "max_throughput": null,
                                        "min_delay": null,
                                        "min_monetary_cost": null,
                                        "normal": null,
                                        "service_value": null
                                    },
                                    "ttl": {
                                        "eq": null,
                                        "gt": null,
                                        "lt": null,
                                        "neq": null,
                                        "range": null
                                    }
                                }
                            ],
                            "acl_type": "standard",
                            "name": "10"
                        },
                        {
                            "aces": [
                                {
                                    "destination": {
                                        "any": true,
                                        "port_protocol": {}
                                    },
                                    "dscp": null,
                                    "evaluate": null,
                                    "fragments": null,
                                    "grant": "permit",
                                    "log": {},
                                    "log_input": {},
                                    "option": {},
                                    "precedence": null,
                                    "protocol": "ip",
                                    "protocol_options": null,
                                    "sequence": 10,
                                    "source": {
                                        "object_group": "my_obj",
                                        "port_protocol": {}
                                    },
                                    "time_range": null,
                                    "tos": {},
                                    "ttl": {}
                                }
                            ],
                            "acl_type": "extended",
                            "name": "110"
                        }
                    ],
                    "afi": "ipv4"
                }
            ],
            "running_config": null,
            "state": "merged"
        }
    },
    "msg": "Unsupported parameters for (basic.py) module: object_group found in config -> acls -> aces -> source. Supported parameters include: address, any, host, port_protocol, wildcard_bits"
}

PLAY RECAP ******************************************************************************************************************************************
router1                    : ok=0    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0
justjais commented 3 years ago

@lbrines Thanks for raising the issue, and I've raised the PR to fix the observed issue, and once merged it'll be queued for June'21 release.