cisco.ios icon indicating copy to clipboard operation
cisco.ios copied to clipboard

argument of type 'bool' is not iterable" error on cisco.ios.ios_bgp_address_family module

Open netexgb opened this issue 2 years ago • 0 comments

SUMMARY

I am trying to configure a neighbor statement under the ipv4 unicast address-family to configure an advertise-map and it gives me error "argument of type 'bool' is not iterable"

ISSUE TYPE
  • Bug Report
COMPONENT NAME

cisco.ios.ios_bgp_address_family

ANSIBLE VERSION
ansible --version
ansible [core 2.13.2]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/gbloise/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/gbloise/.local/lib/python3.8/site-packages/ansible
  ansible collection location = /home/gbloise/.ansible/collections
  executable location = /home/gbloise/.local/bin/ansible
  python version = 3.8.10 (default, Jun 22 2022, 20:18:18) [GCC 9.4.0]
  jinja version = 3.1.2
  libyaml = True
COLLECTION VERSION
ansible-galaxy collection list cisco.ios
# /home/gbloise/.local/lib/python3.8/site-packages/ansible_collections
Collection Version
---------- -------
cisco.ios  3.3.0

# /usr/local/lib/python3.8/dist-packages/ansible_collections
Collection Version
---------- -------
cisco.ios  3.3.0

# /home/gbloise/.ansible/collections/ansible_collections
Collection Version
---------- -------
cisco.ios  3.3.0
CONFIGURATION
COLLECTIONS_PATHS(/etc/ansible/ansible.cfg) = ['/home/gbloise/.ansible/collections']
DEPRECATION_WARNINGS(/etc/ansible/ansible.cfg) = True
HOST_KEY_CHECKING(/etc/ansible/ansible.cfg) = True
PARAMIKO_HOST_KEY_AUTO_ADD(/etc/ansible/ansible.cfg) = True
PARAMIKO_LOOK_FOR_KEYS(/etc/ansible/ansible.cfg) = True
RETRY_FILES_ENABLED(/etc/ansible/ansible.cfg) = False
TASK_TIMEOUT(/etc/ansible/ansible.cfg) = 0
OS / ENVIRONMENT
us1896-atlanta2-dc-cs#show version
Cisco IOS XE Software, Version 16.09.08
Cisco IOS Software [Fuji], ASR1000 Software (X86_64_LINUX_IOSD-UNIVERSALK9-M), Version 16.9.8, RELEASE SOFTWARE (fc4)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2021 by Cisco Systems, Inc.
Compiled Wed 01-Sep-21 01:43 by mcpre


Cisco IOS-XE software, Copyright (c) 2005-2021 by cisco Systems, Inc.
All rights reserved.  Certain components of Cisco IOS-XE software are
licensed under the GNU General Public License ("GPL") Version 2.0.  The
software code licensed under GPL Version 2.0 is free software that comes
with ABSOLUTELY NO WARRANTY.  You can redistribute and/or modify such
GPL code under the terms of GPL Version 2.0.  For more details, see the
documentation or "License Notice" file accompanying the IOS-XE software,
or the applicable URL provided on the flyer accompanying the IOS-XE
software.


ROM: IOS-XE ROMMON

us1896-atlanta2-dc-cs uptime is 27 weeks, 6 days, 1 hour, 39 minutes
Uptime for this control processor is 27 weeks, 6 days, 1 hour, 41 minutes
System returned to ROM by PowerOn
System restarted at 15:29:06 GMT Wed Feb 2 2022
System image file is "bootflash:asr1000-universalk9.16.09.08.SPA.bin"
Last reload reason: PowerOn



This product contains cryptographic features and is subject to United
States and local country laws governing import, export, transfer and
use. Delivery of Cisco cryptographic products does not imply
third-party authority to import, export, distribute or use encryption.
Importers, exporters, distributors and users are responsible for
compliance with U.S. and local country laws. By using this product you
agree to comply with applicable laws and regulations. If you are unable
to comply with U.S. and local laws, return this product immediately.

A summary of U.S. laws governing Cisco cryptographic products may be found at:
http://www.cisco.com/wwl/export/crypto/tool/stqrg.html

If you require further assistance please contact us by sending email to
[email protected].

License Type: Smart License
License Level: adventerprise
Next reload license Level: ipbase

The current crypto throughput level is 8000000 kbps


Smart Licensing Status: REGISTERED/AUTHORIZED

cisco ASR1002-HX (2KH) processor (revision 2KH) with 6924984K/6147K bytes of memory.
Processor board ID FXS2515Q1AR
Crypto Hardware Module present
8 Gigabit Ethernet interfaces
8 Ten Gigabit Ethernet interfaces
32768K bytes of non-volatile configuration memory.
16777216K bytes of physical memory.
29908991K bytes of eUSB flash at bootflash:.
0K bytes of WebUI ODM Files at webui:.

Configuration register is 0x2102
STEPS TO REPRODUCE
- name: Versa Conditional Advertisement - US1896 DC Routers
  hosts:
    - us1896d
  gather_facts: False

  tasks:
  - name: BGP Neighbor Advertise-Map
    when: inventory_hostname == "us1896-atlanta2-dc-cs.mgmt.slb.net"
    cisco.ios.ios_bgp_address_family:
      config:
        as_number: 72
        address_family:
          - afi: ipv4
            safi: unicast
            neighbor:
              - address: 172.26.0.22
                activate: yes
                advertise_map:
                  name: VERSA-HUBS-ADVERTISE
                  non_exist_map: VERSA-HUBS-LOOPBACKS-DETECT
      state: merged
EXPECTED RESULTS
us1896-atlanta2-dc-cs#sh run | i neig.*172.26.0.22
 neighbor 172.26.0.22 remote-as 852
 neighbor 172.26.0.22 description TELUS peer | NOTMONITORED
 neighbor 172.26.0.22 shutdown
 neighbor 172.26.0.22 password 7 06575A7919165F48
  neighbor 172.26.0.22 advertise-map VERSA-HUBS-ADVERTISE non-exist-map VERSA-HUBS-LOOPBACKS-DETECT
  neighbor 172.26.0.22 activate
  neighbor 172.26.0.22 send-community
  neighbor 172.26.0.22 soft-reconfiguration inbound
  neighbor 172.26.0.22 route-map DENY_ALL in
  neighbor 172.26.0.22 route-map DENY_ALL out

ACTUAL RESULTS
gbloise@SLB-3PNZTT2:/mnt/c/Users/GBloise/Repositories/SINet%20Cloud%20Infrastructure/playbooks$ ansible-playbook us1896-test.yml -k -vvvv
ansible-playbook [core 2.13.2]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/gbloise/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/gbloise/.local/lib/python3.8/site-packages/ansible
  ansible collection location = /home/gbloise/.ansible/collections
  executable location = /home/gbloise/.local/bin/ansible-playbook
  python version = 3.8.10 (default, Jun 22 2022, 20:18:18) [GCC 9.4.0]
  jinja version = 3.1.2
  libyaml = True
Using /etc/ansible/ansible.cfg as config file
SSH password:
setting up inventory plugins
host_list declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
script declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
auto declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Parsed /etc/ansible/hosts inventory source with yaml plugin
Loading collection cisco.ios from /home/gbloise/.ansible/collections/ansible_collections/cisco/ios
Loading callback plugin default of type stdout, v2.0 from /home/gbloise/.local/lib/python3.8/site-packages/ansible/plugins/callback/default.py
Skipping callback 'default', as we already have a stdout callback.
Skipping callback 'minimal', as we already have a stdout callback.
Skipping callback 'oneline', as we already have a stdout callback.

PLAYBOOK: us1896-test.yml ***********************************************************************************************************************************************************************************************************************************Positional arguments: us1896-test.yml
verbosity: 4
connection: smart
timeout: 10
ask_pass: True
become_method: sudo
tags: ('all',)
inventory: ('/etc/ansible/hosts',)
forks: 5
1 plays in us1896-test.yml

PLAY [Versa Conditional Advertisement - US1896 DC Routers] **************************************************************************************************************************************************************************************************META: ran handlers

TASK [BGP Neighbor Advertise-Map] ***************************************************************************************************************************************************************************************************************************task path: /mnt/c/Users/GBloise/Repositories/SINet%20Cloud%20Infrastructure/playbooks/us1896-test.yml:7
skipping: [us1896-atlanta1-dc-cs.mgmt.slb.net] => {
    "changed": false,
    "skip_reason": "Conditional result was False"
}
Loading collection ansible.netcommon from /home/gbloise/.ansible/collections/ansible_collections/ansible/netcommon
redirecting (type: terminal) ansible.builtin.ios to cisco.ios.ios
redirecting (type: cliconf) ansible.builtin.ios to cisco.ios.ios
<us1896-atlanta2-dc-cs.mgmt.slb.net> attempting to start connection
<us1896-atlanta2-dc-cs.mgmt.slb.net> using connection plugin ansible.netcommon.network_cli
Found ansible-connection at path /home/gbloise/.local/bin/ansible-connection
<us1896-atlanta2-dc-cs.mgmt.slb.net> local domain socket does not exist, starting it
<us1896-atlanta2-dc-cs.mgmt.slb.net> control socket path is /home/gbloise/.ansible/pc/52b6d49bee
<us1896-atlanta2-dc-cs.mgmt.slb.net> Loading collection ansible.netcommon from /home/gbloise/.ansible/collections/ansible_collections/ansible/netcommon
<us1896-atlanta2-dc-cs.mgmt.slb.net> redirecting (type: terminal) ansible.builtin.ios to cisco.ios.ios
<us1896-atlanta2-dc-cs.mgmt.slb.net> Loading collection cisco.ios from /home/gbloise/.ansible/collections/ansible_collections/cisco/ios
<us1896-atlanta2-dc-cs.mgmt.slb.net> redirecting (type: cliconf) ansible.builtin.ios to cisco.ios.ios
<us1896-atlanta2-dc-cs.mgmt.slb.net> local domain socket listeners started successfully
<us1896-atlanta2-dc-cs.mgmt.slb.net> loaded cliconf plugin ansible_collections.cisco.ios.plugins.cliconf.ios from path /home/gbloise/.ansible/collections/ansible_collections/cisco/ios/plugins/cliconf/ios.py for network_os ios
<us1896-atlanta2-dc-cs.mgmt.slb.net> ssh type is set to auto
<us1896-atlanta2-dc-cs.mgmt.slb.net> autodetecting ssh_type
[WARNING]: ansible-pylibssh not installed, falling back to paramiko
<us1896-atlanta2-dc-cs.mgmt.slb.net> ssh type is now set to paramiko
<us1896-atlanta2-dc-cs.mgmt.slb.net>
<us1896-atlanta2-dc-cs.mgmt.slb.net> local domain socket path is /home/gbloise/.ansible/pc/52b6d49bee
<us1896-atlanta2-dc-cs.mgmt.slb.net> Using network group action cisco.ios.ios for cisco.ios.ios_bgp_address_family
<us1896-atlanta2-dc-cs.mgmt.slb.net> ANSIBLE_NETWORK_IMPORT_MODULES: enabled
<us1896-atlanta2-dc-cs.mgmt.slb.net> ANSIBLE_NETWORK_IMPORT_MODULES: found cisco.ios.ios_bgp_address_family  at /home/gbloise/.ansible/collections/ansible_collections/cisco/ios/plugins/modules/ios_bgp_address_family.py
<us1896-atlanta2-dc-cs.mgmt.slb.net> ANSIBLE_NETWORK_IMPORT_MODULES: running cisco.ios.ios_bgp_address_family
<us1896-atlanta2-dc-cs.mgmt.slb.net> ANSIBLE_NETWORK_IMPORT_MODULES: complete
The full traceback is:
  File "/home/gbloise/.ansible/collections/ansible_collections/ansible/netcommon/plugins/module_utils/network/common/facts/facts.py", line 133, in get_network_resources_facts
    inst.populate_facts(
  File "/home/gbloise/.ansible/collections/ansible_collections/cisco/ios/plugins/module_utils/network/ios/facts/bgp_address_family/bgp_address_family.py", line 169, in populate_facts
    bgp_af_parser.validate_config(
  File "/home/gbloise/.ansible/collections/ansible_collections/ansible/netcommon/plugins/module_utils/network/common/rm_base/network_template.py", line 153, in validate_config
    validated_data = _validate_config(spec, data)
  File "/home/gbloise/.ansible/collections/ansible_collections/ansible/netcommon/plugins/module_utils/network/common/utils.py", line 678, in validate_config
    validated_data = basic.AnsibleModule(spec).params
  File "/home/gbloise/.local/lib/python3.8/site-packages/ansible/module_utils/basic.py", line 502, in __init__
    self.validation_result = self.validator.validate(self.params)
  File "/home/gbloise/.local/lib/python3.8/site-packages/ansible/module_utils/common/arg_spec.py", line 268, in validate
    result = super(ModuleArgumentSpecValidator, self).validate(parameters)
  File "/home/gbloise/.local/lib/python3.8/site-packages/ansible/module_utils/common/arg_spec.py", line 236, in validate
    _validate_sub_spec(self.argument_spec, result._validated_parameters,
  File "/home/gbloise/.local/lib/python3.8/site-packages/ansible/module_utils/common/parameters.py", line 785, in _validate_sub_spec
    _validate_sub_spec(sub_spec, sub_parameters, new_prefix, options_context, errors, no_log_values, unsupported_parameters)
  File "/home/gbloise/.local/lib/python3.8/site-packages/ansible/module_utils/common/parameters.py", line 785, in _validate_sub_spec
    _validate_sub_spec(sub_spec, sub_parameters, new_prefix, options_context, errors, no_log_values, unsupported_parameters)
  File "/home/gbloise/.local/lib/python3.8/site-packages/ansible/module_utils/common/parameters.py", line 785, in _validate_sub_spec
    _validate_sub_spec(sub_spec, sub_parameters, new_prefix, options_context, errors, no_log_values, unsupported_parameters)
  File "/home/gbloise/.local/lib/python3.8/site-packages/ansible/module_utils/common/parameters.py", line 730, in _validate_sub_spec
    no_log_values.update(set_fallbacks(sub_spec, sub_parameters))
  File "/home/gbloise/.local/lib/python3.8/site-packages/ansible/module_utils/common/parameters.py", line 806, in set_fallbacks
    if param not in parameters and fallback_strategy is not None:
fatal: [us1896-atlanta2-dc-cs.mgmt.slb.net]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "config": {
                "address_family": [
                    {
                        "afi": "ipv4",
                        "aggregate_address": null,
                        "auto_summary": null,
                        "bgp": null,
                        "default": null,
                        "default_information": null,
                        "default_metric": null,
                        "distance": null,
                        "neighbor": [
                            {
                                "activate": true,
                                "additional_paths": null,
                                "address": "172.26.0.22",
                                "advertise": null,
                                "advertise_map": {
                                    "exist_map": null,
                                    "name": "VERSA-HUBS-ADVERTISE",
                                    "non_exist_map": "VERSA-HUBS-LOOPBACKS-DETECT"
                                },
                                "advertisement_interval": null,
                                "aigp": null,
                                "allow_policy": null,
                                "allowas_in": null,
                                "as_override": null,
                                "bmp_activate": null,
                                "capability": null,
                                "cluster_id": null,
                                "default_originate": null,
                                "description": null,
                                "disable_connected_check": null,
                                "distribute_list": null,
                                "dmzlink_bw": null,
                                "ebgp_multihop": null,
                                "fall_over": null,
                                "filter_list": null,
                                "ha_mode": null,
                                "inherit": null,
                                "internal_vpn_client": null,
                                "ipv6_adddress": null,
                                "local_as": null,
                                "log_neighbor_changes": null,
                                "maximum_prefix": null,
                                "next_hop_self": null,
                                "next_hop_unchanged": null,
                                "nexthop_self": null,
                                "password": null,
                                "path_attribute": null,
                                "peer_group": null,
                                "prefix_list": null,
                                "prefix_lists": null,
                                "remote_as": null,
                                "remove_private_as": null,
                                "route_map": null,
                                "route_maps": null,
                                "route_reflector_client": null,
                                "route_server_client": null,
                                "send_community": null,
                                "shutdown": null,
                                "slow_peer": null,
                                "soft_reconfiguration": null,
                                "soo": null,
                                "tag": null,
                                "timers": null,
                                "transport": null,
                                "ttl_security": null,
                                "unsuppress_map": null,
                                "version": null,
                                "weight": null
                            }
                        ],
                        "network": null,
                        "redistribute": null,
                        "safi": "unicast",
                        "snmp": null,
                        "table_map": null,
                        "vrf": null
                    }
                ],
                "as_number": "72"
            },
            "running_config": null,
            "state": "merged"
        }
    },
    "msg": "argument of type 'bool' is not iterable"
}
META: ran handlers
META: ran handlers

PLAY RECAP **************************************************************************************************************************************************************************************************************************************************us1896-atlanta1-dc-cs.mgmt.slb.net : ok=0    changed=0    unreachable=0    failed=0    skipped=1    rescued=0    ignored=0
us1896-atlanta2-dc-cs.mgmt.slb.net : ok=0    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0

netexgb avatar Aug 16 '22 17:08 netexgb