aruba / aoscx-ansible-collection

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

aoscx_facts - timeout issue #27

Closed estebanmilaho closed 1 year ago

estebanmilaho commented 2 years ago

Ansible 2.12.5 Python 3.7.12

I'm trying to get information on the 'admin_state' for each interface of an Aruba Switch with the aoscx_facts module. Every time i run my playbook i get a timeout error:

select_page failed [Transaction Failed due to an error: timeout]: &{OpenSwitch 7 [{select_page Port map[] [] [_uuid port_access_onboarding_precedence ipv6_nd_prefix_default pim_hello_interval ospf_bfd ospfv3_ipsec_esp aclv6_in_cfg ospf_if_type pim_vsx_virtual_neighbor mvrp_last_pdu_src_mac vrf ospf_auth_text_key active_ip4_address_secondary ospfv3_hello_interval ipv6_icmpv6_pkts_statistics egress_redirect_to_port policy_in_status mvrp_timers aclv4_out_cfg_version ipv6_nd_ra_reachable_time aclmac_out_status ospf_auth_md5_keys stp_status aclmac_out_statistics applied_extended_access_vlans arp_timeout dynamic_ip_mtu ip6_addresses admin flaps_requested mvrp_enable pim_ipv6_pending_starg_sg_entries stp_config dhcp_config port_access_clients_limit pim_proxy_dr ospf_neighbor_clear_requested aclmac_in_statistics bfd_detect_multiplier bfd_echo_disable aclv6_routed_in_status mgmd_last_member_query_interval applied_vlan_mode port_access_allow_flood_traffic aclv4_out_applied aclv6_routed_out_status aclv6_out_applied dhcp_info ospf_intervals pim_lan_prune_delay_disable policy_routed_in_applied active_ip4_address urpf_check mgmd_acl mac_learn_disable port_access_disable_cdp_auth ipv6_nd_icmpv6_redirects virtual_ip4_routers policy_routed_in_statistics virtual_gw_l3_src_mac_enable loop_protect_enable ip_directed_broadcast mgmd_dynamic_group_count ospf_priority ipv6_source_lockdown_enable pim_elected_dr_priority policy_out_cfg_version ifindex port_access_critical_auth_role aclmac_out_cfg_version aclmac_out_cfg ipv6_nd_ra_dnssl aclv4_in_cfg_version policy_out_status ipv6_nd_ns_interval ospfv3_if_priority policy_routed_in_cfg_version aclv6_in_cfg_version bond_mode l3_counters_enable ip6_address_custom_link_local active_ip_mtu ip4_address vlan_trunks ospf_neighbor_clear_performed bond_status ipv6_nd_ra_lifetime aclv6_routed_in_applied ospf_auth_sha_keys rate_limits_status ipv6_nd_dad_attempts flaps_performed aclmac_in_cfg_version port_access_auth_role dot1x_authenticator_statistics aclv4_routed_out_subsystem_states port_access_operational_auth_mode aclv4_out_statistics name policy_in_cfg pim_override_interval queue_bandwidth_status ipv6_nd_ra_retransmit_timer erps_port_blocked ospf_auth_keychain port_security aclv6_routed_out_cfg bond_active_slave policy_out_cfg mgmd_mld_static_groups ipv6_nd_ra_other_config_flag vsx_shutdown_on_split ipv6_nd_mtu mgmd_enable_status mgmd_mld_version ipv6_address_autoconfig_enable port_access_vlan_trunks mdns_sd_statistics mgmd_querier_enable aclv6_routed_in_cfg ipv6_nd_ra_managed_flag aclv4_in_cfg pim_ipv6_packet_counters q_profile port_access_pre_auth_role mgmd_querier_timer_info aclv4_in_applied ospfv3_neighbor_clear_performed routing ip4_address_secondary ospfv3_if_shutdown rdisc_irdp_enable egress_blocked_to_ports macs_invalid_on_vlans ip_neighbor_flood port_access_security_violation pim_dr_priority loop_protect_vlan bfd_min_tx_interval loop_detect_source port_access_reauthentication_requested mgmd_igmp_version aclv4_routed_in_cfg_version aclv4_out_status ipv4_source_lockdown_hw_status port_access_auth_mode aclv6_out_cfg mvrp_statistics description ipv6_neighbor_timeout policy_in_applied vsx_virtual_ip4 aclv6_in_status mac arp_inspection mgmd_counters aaa_auth_precedence rdisc_irdp_timers vlan_translation_hw_status aclv6_in_applied policy_out_applied vsx_virtual_gw_mac_v6 aclv6_routed_out_subsystem_states ipv6_nd_ra_min_interval qos_config aclv6_in_statistics vlans_per_protocol mgmd_querier_interval ipv6_address_linklocal_enable rdisc_irdp_broadcast aclv6_routed_in_cfg_version active_ipv6_ll_source ospfv3_dead_interval ospfv3_bfd policy_routed_in_status port_access_auth_configurations port_access_qos_trust loop_protect_port_disabled port_access_stp_admin_edge rate_limits aclv4_out_cfg aclv6_routed_out_statistics ip_mtu aclv4_routed_in_subsystem_states mgmd_strict_version_enable policy_in_conform_rate aclv4_routed_in_status vlan_mode ospfv3_if_type aclv6_out_statistics pim_propagation_delay nd_snooping_configuration loop_protect_status ipv6_ra_counters mgmd_snoop_fastlearn_enable policy_routed_in_cfg pim_dr_role clear_ip_bindings vrrpv3_statistics interfaces aaa_auth_priority ip6_autoconfigured_addresses aclmac_in_cfg port_access_fallback_role ipv6_source_lockdown_hw_status rdisc_irdp_preference mgmd_oper_version mdns_sd_tx_profile aclv4_in_status process_grat_arp ospf_if_shutdown loop_protect_action icmp_unreachable_ratelimit aclv4_routed_in_applied mgmd_querier_ip dhcpv4_snooping_configuration mac_auth_statistics pim_source_address port_access_security_violation_reason aclv6_out_cfg_version dhcpv6_snooping_configuration qos_status lacp_status aclmac_in_applied virtual_gw_operational_l3_src_mac ipv6_nd_router_preference ospfv3_retransmit_interval icmp_redirect_disable aclv4_routed_out_cfg_version lacp aclv6_out_status port_access_disable_lldp_auth aclv6_routed_out_cfg_version pim_mode ipv6_nd_ra_max_interval mvrp_vlans port_access_concurrent_onboarding mgmd_querier_max_response_time port_access_policy_in_applied num_clear_sflow_stats_performed vsx_virtual_ip6 client_ip_track_configuration policy_in_statistics aclv4_routed_in_statistics pim_ipv4_packet_counters port_access_reauthentication_performed aclv4_routed_out_statistics port_access_policy_in_status applied_vlans_per_protocol bfd_min_rx_interval ipv6_nd_icmpv6_timestamp mgmd_enable ospfv3_neighbor_clear_requested status port_security_static_client_mac_addr ip6_address_link_local ipv6_nd_ra_rdnss vsx_virtual_gw_mac_v4 policy_routed_in_conform_rate mdns_sd_enable icmp_unreachable_disable vrrpv2_statistics pim_operational vlan_translations mvrp_registration device_profile aclv4_routed_out_applied vrrpv3_status applied_vlan_trunks vlan_tag ospf_if_out_cost port_access_reject_role policy_out_conform_rate virtual_ip6_routers aclv4_routed_in_cfg aclmac_out_applied flood_block aclv4_routed_out_cfg pim_bfd aclmac_in_status port_security_static_sticky_client_mac_addr aclv4_in_statistics ipv4_source_lockdown_enable policy_out_statistics mgmd_igmp_static_groups ospfv3_ipsec_ah other_config port_access_vlan_mode mgmd_robustness aclv6_routed_out_applied mgmd_querier_state pim_ipv4_pending_starg_sg_entries applied_vlan_tag dyn_trunks aclv4_routed_out_status active_ipv4_address_source pim_dense_graft_retry_interval pim_operational_dr_priority pim_trig_hello_interval dhcp_relay_statistics port_access_allow_bpdu aclv6_routed_in_statistics num_clear_sflow_stats_requested pim_dense_max_graft_retries loop_protect_stagger_count ospf_auth_type ospfv3_transmit_delay mvrp_forbidden_vlans port_access_extended_access_vlans policy_in_cfg_version macs_invalid aclv6_routed_in_subsystem_states ipv6_nd_ra_hoplimit qos pim_dense_ttl_threshold pim_elected_dr_address capacities_status portfilter origin ospfv3_if_cost ipv6_nd_suppress_ra loop_protect_statistics policy_routed_in_subsystem_states port_access_vlan_tag forwarding_state] [] 15000 []   50 9137536649588478162 false  false false false}] map[] [] [{0 map[]   {} [] done Port} {0 map[] timeout select_page timeout {} []  }] 0x400e58f310}

This is the playbook that produces that error for me:

- hosts: aruba
  collections:
    - arubanetworks.aoscx
  gather_facts: False
  vars:
    ssl_verify: false
    ansible_httpapi_use_ssl: true
    ansible_httpapi_validate_certs: false
    ansible_httpapi_port: 443
    ansible_python_interpreter: /bin/python3
  tasks:
    - name: Gather facts
      aoscx_facts:
        gather_subset:
          - host_name
          - physical_interfaces
        gather_network_resources:
          - interfaces
      register: facts_output

Requesting the information i need directly via the API also works for me with the following request URL: [https://<>/rest/v10.09/system/interfaces?attributes=admin_state&depth=2&selector=status]() This request gets my a response similar to the following one:

{
  "1/1/1": {
    "admin_state": "up"
  },
  "1/1/10": {
    "admin_state": "down"
  }
}

What also works is running the playbook without any subset, but then there is no information about the 'admin_state' in the response:

- hosts: aruba
  collections:
    - arubanetworks.aoscx
  gather_facts: False
  vars:
    ssl_verify: false
    ansible_httpapi_use_ssl: true
    ansible_httpapi_validate_certs: false
    ansible_httpapi_port: 443
    ansible_python_interpreter: /bin/python3
  tasks:
    - name: Gather facts
      aoscx_facts:
      register: facts_output

Can someone assist me with that issue?

tchiapuziowong commented 2 years ago

Can you share the firmware version and the switch model so I can try and reproduce this issue?

estebanmilaho commented 2 years ago

The firmware version is FL.10.09.0010. The Model is a 6300M 48SR5 CL6 PoE 4SFP56 Swch.

tchiapuziowong commented 2 years ago

Hello - I've attempted to reproduce the issue in my set up and didn't run into any issues, here are my environment details:

ansible [core 2.12.1]
  config file = /ws/chiapuzi/tme/sandbox/cx_playbooks/ansible.cfg
  configured module search path = ['/users/chiapuzi/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /ws/chiapuzi/tme/sandbox/py3_ansible/lib/python3.8/site-packages/ansible
  ansible collection location = /users/chiapuzi/.ansible/collections:/usr/share/ansible/collections
  executable location = /ws/chiapuzi/tme/sandbox/py3_ansible/bin/ansible
  python version = 3.8.9 (default, Apr  3 2021, 01:02:10) [GCC 5.4.0 20160609]
  jinja version = 3.0.1
  libyaml = True

6300(config)# show version
-----------------------------------------------------------------------------
ArubaOS-CX
(c) Copyright 2017-2022 Hewlett Packard Enterprise Development LP
-----------------------------------------------------------------------------
Version      : FL.10.09.0010                                                 
Build Date   : 2022-02-01 01:24:29 UTC                                       
Build ID     : ArubaOS-CX:FL.10.09.0010:e88980c9a1b3:202201312335            
Build SHA    : e88980c9a1b3a934174127ff297b2adc51ee3915                      
Active Image : primary                       

Service OS Version : FL.01.11.0001-internal        
BIOS Version       : FL.01.0004                    
6300(config)# 

(py3_ansible) ansible-control-machine$cat facts_collections.yml
- hosts: all
  name: Test playbook with Aruba API connection
  collections:
    - arubanetworks.aoscx
  vars:
  gather_facts: False
  tasks:
    - name: USE API TO GET HOSTNAME
      aoscx_facts:
        gather_subset:
          - host_name
          - physical_interfaces
        gather_network_resources:
          - interfaces
      register: facts_output

    - name: PRINT OUT GATHERED FACTS
      debug:
        var: facts_output

(py3_ansible) ansible-control-machine$cat hosts.yml
all:
  hosts:
    switch-6300:
      ansible_host: 10.100.18.32
      ansible_user: admin
      ansible_password: admin
      ansible_network_os: arubanetworks.aoscx.aoscx
      ansible_connection: arubanetworks.aoscx.aoscx  # REST API via pyaoscx connection method
      ansible_aoscx_validate_certs: False
      ansible_aoscx_use_proxy: False
      ansible_acx_no_proxy: True

I would recommend updating python and the python libraries required by the collection. Please ensure your ansible_connection is set to arubanetworks.aoscx.aoscx since this module is using REST API. If you're still encountering the error please work with your SE to get support in troubleshooting.

estebanmilaho commented 2 years ago

I've updated my libraries and python. My ansible_connection was set to httpapi. If i set it to arubanetworks.aoscx.aoscx none of the above playbooks works not even the one that worked before. The error message with -vvv then is:

The full traceback is:
Traceback (most recent call last):
  File "/home/user/.ansible/tmp/ansible-local-1332rznklgqi/ansible-tmp-1653374374.3619854-1337-31889346175505/AnsiballZ_aoscx_facts.py", line 107, in <module>
    _ansiballz_main()
  File "/home/user/.ansible/tmp/ansible-local-1332rznklgqi/ansible-tmp-1653374374.3619854-1337-31889346175505/AnsiballZ_aoscx_facts.py", line 99, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/home/user/.ansible/tmp/ansible-local-1332rznklgqi/ansible-tmp-1653374374.3619854-1337-31889346175505/AnsiballZ_aoscx_facts.py", line 47, in invoke_module
    runpy.run_module(mod_name='ansible_collections.arubanetworks.aoscx.plugins.modules.aoscx_facts', init_globals=dict(_module_fqn='ansible_collections.arubanetworks.aoscx.plugins.modules.aoscx_facts', _modlib_path=modlib_path),
  File "/usr/lib/python3.8/runpy.py", line 207, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/usr/lib/python3.8/runpy.py", line 97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/tmp/ansible_aoscx_facts_payload_7rp88ilq/ansible_aoscx_facts_payload.zip/ansible_collections/arubanetworks/aoscx/plugins/modules/aoscx_facts.py", line 405, in <module>
  File "/tmp/ansible_aoscx_facts_payload_7rp88ilq/ansible_aoscx_facts_payload.zip/ansible_collections/arubanetworks/aoscx/plugins/modules/aoscx_facts.py", line 396, in main
  File "/tmp/ansible_aoscx_facts_payload_7rp88ilq/ansible_aoscx_facts_payload.zip/ansible_collections/arubanetworks/aoscx/plugins/module_utils/facts/facts.py", line 82, in get_facts
  File "/tmp/ansible_aoscx_facts_payload_7rp88ilq/ansible_aoscx_facts_payload.zip/ansible_collections/arubanetworks/aoscx/plugins/module_utils/facts/facts.py", line 101, in get_switch_running_config
  File "/tmp/ansible_aoscx_facts_payload_7rp88ilq/ansible_aoscx_facts_payload.zip/ansible_collections/arubanetworks/aoscx/plugins/module_utils/aoscx.py", line 385, in get
  File "/tmp/ansible_aoscx_facts_payload_7rp88ilq/ansible_aoscx_facts_payload.zip/ansible_collections/arubanetworks/aoscx/plugins/module_utils/aoscx.py", line 235, in get
  File "/tmp/ansible_aoscx_facts_payload_7rp88ilq/ansible_aoscx_facts_payload.zip/ansible/module_utils/connection.py", line 200, in __rpc__
ansible.module_utils.connection.ConnectionError: Method not found
fatal: [testhost]: FAILED! => changed=false
  module_stderr: |-
    Traceback (most recent call last):
      File "/home/user/.ansible/tmp/ansible-local-1332rznklgqi/ansible-tmp-1653374374.3619854-1337-31889346175505/AnsiballZ_aoscx_facts.py", line 107, in <module>
        _ansiballz_main()
      File "/home/user/.ansible/tmp/ansible-local-1332rznklgqi/ansible-tmp-1653374374.3619854-1337-31889346175505/AnsiballZ_aoscx_facts.py", line 99, in _ansiballz_main
        invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
      File "/home/user/.ansible/tmp/ansible-local-1332rznklgqi/ansible-tmp-1653374374.3619854-1337-31889346175505/AnsiballZ_aoscx_facts.py", line 47, in invoke_module
        runpy.run_module(mod_name='ansible_collections.arubanetworks.aoscx.plugins.modules.aoscx_facts', init_globals=dict(_module_fqn='ansible_collections.arubanetworks.aoscx.plugins.modules.aoscx_facts', _modlib_path=modlib_path),
      File "/usr/lib/python3.8/runpy.py", line 207, in run_module
        return _run_module_code(code, init_globals, run_name, mod_spec)
      File "/usr/lib/python3.8/runpy.py", line 97, in _run_module_code
        _run_code(code, mod_globals, init_globals,
      File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
        exec(code, run_globals)
      File "/tmp/ansible_aoscx_facts_payload_7rp88ilq/ansible_aoscx_facts_payload.zip/ansible_collections/arubanetworks/aoscx/plugins/modules/aoscx_facts.py", line 405, in <module>
      File "/tmp/ansible_aoscx_facts_payload_7rp88ilq/ansible_aoscx_facts_payload.zip/ansible_collections/arubanetworks/aoscx/plugins/modules/aoscx_facts.py", line 396, in main
      File "/tmp/ansible_aoscx_facts_payload_7rp88ilq/ansible_aoscx_facts_payload.zip/ansible_collections/arubanetworks/aoscx/plugins/module_utils/facts/facts.py", line 82, in get_facts
      File "/tmp/ansible_aoscx_facts_payload_7rp88ilq/ansible_aoscx_facts_payload.zip/ansible_collections/arubanetworks/aoscx/plugins/module_utils/facts/facts.py", line 101, in get_switch_running_config
      File "/tmp/ansible_aoscx_facts_payload_7rp88ilq/ansible_aoscx_facts_payload.zip/ansible_collections/arubanetworks/aoscx/plugins/module_utils/aoscx.py", line 385, in get
      File "/tmp/ansible_aoscx_facts_payload_7rp88ilq/ansible_aoscx_facts_payload.zip/ansible_collections/arubanetworks/aoscx/plugins/module_utils/aoscx.py", line 235, in get
      File "/tmp/ansible_aoscx_facts_payload_7rp88ilq/ansible_aoscx_facts_payload.zip/ansible/module_utils/connection.py", line 200, in __rpc__
    ansible.module_utils.connection.ConnectionError: Method not found
  module_stdout: ''
  msg: |-
    MODULE FAILURE
    See stdout/stderr for the exact error
  rc: 1
tchiapuziowong commented 2 years ago

Can you run the following command and see if that changes the result? python3 -m pip install --upgrade --force-reinstall git+https://github.com/aruba/pyaoscx.git

estebanmilaho commented 2 years ago

Unfortunately still the same error.

DonRhodes commented 2 years ago

I am seeing a similar issue where the "ansible_net_interfaces" section of the facts is coming in mostly blank, other sections of the facts appear to be OKAY.

$ ansible --version
ansible 2.9.6
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/zadmin/.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.10 (default, Jun 22 2022, 20:18:18) [GCC 9.4.0]
myswitch# show version
-----------------------------------------------------------------------------
ArubaOS-CX
(c) Copyright 2017-2022 Hewlett Packard Enterprise Development LP
-----------------------------------------------------------------------------
Version      : FL.10.09.1040
Build Date   : 2022-07-19 00:08:38 UTC
Build ID     : ArubaOS-CX:FL.10.09.1040:a97700001a3f:202207182249
Build SHA    : a97700001a3fff8619a96db997b2963b244ff0bd
Active Image : secondary

Service OS Version : FL.01.09.0002
BIOS Version       : FL.01.0002
  - name: Gather facts
    aoscx_facts:

  - name:
    ansible.builtin.debug:
      msg:
        - " {{ (ansible_facts['net_interfaces']) }} "
        - " {{ (ansible_facts['net_software_info']) }} "
TASK [ansible.builtin.debug] ********************************************************************************************************************
ok: [myswitch] => changed=false
  msg:
  - ' {''chassis,1'': {}, ''chassis,10'': {}, ''chassis,2'': {}, ''chassis,3'': {}, ''chassis,4'': {}, ''chassis,5'': {}, ''chassis,6'': {}, ''chassis,7'': {}, ''chassis,8'': {}, ''chassis,9'': {}, ''fan_tray,1/1'': {}, ''fan_tray,1/2'': {}, ''fan_tray,10/1'': {}, ''fan_tray,10/2'': {}, ''fan_tray,2/1'': {}, ''fan_tray,2/2'': {}, ''fan_tray,3/1'': {}, ''fan_tray,3/2'': {}, ''fan_tray,4/1'': {}, ''fan_tray,4/2'': {}, ''fan_tray,5/1'': {}, ''fan_tray,5/2'': {}, ''fan_tray,6/1'': {}, ''fan_tray,6/2'': {}, ''fan_tray,7/1'': {}, ''fan_tray,7/2'': {}, ''fan_tray,8/1'': {}, ''fan_tray,8/2'': {}, ''fan_tray,9/1'': {}, ''fan_tray,9/2'': {}, ''line_card,1/1'': {}, ''line_card,10/1'': {}, ''line_card,2/1'': {}, ''line_card,3/1'': {}, ''line_card,4/1'': {}, ''line_card,5/1'': {}, ''line_card,6/1'': {}, ''line_card,7/1'': {}, ''line_card,8/1'': {}, ''line_card,9/1'': {}, ''management_module,1/1'': {}, ''management_module,10/1'': {}, ''management_module,2/1'': {}, ''management_module,3/1'': {}, ''management_module,4/1'':
    {}, ''management_module,5/1'': {}, ''management_module,6/1'': {}, ''management_module,7/1'': {}, ''management_module,8/1'': {}, ''management_module,9/1'': {}} '
  - ' {''build_date'': ''2022-07-19 00:08:38 UTC'', ''build_id'': ''ArubaOS-CX:FL.10.09.1040:a97700001a3f:202207182249'', ''build_sha'': ''a97700001a3fff8619a96db997b2963b244ff0bd'', ''os_name'': ''ArubaOS-CX''}'

If I run this same playbook on a 10.07.0061 switch the information is returned.

tchiapuziowong commented 2 years ago

Hi @DonRhodes & @estebanmilaho -

I've repeated the same playbook and received the desired information through the following playbook and environment, please validate each package/collection/ansible version reflects similar to below: (py3_ansible) ansible-control-machine$pip3 list Package Version


ansible 5.0.1 ansible-core 2.12.1 ansible-pylibssh 0.3.0 bcrypt 3.2.2 certifi 2022.6.15 cffi 1.15.1 charset-normalizer 2.1.0 cryptography 37.0.4 idna 3.3 Jinja2 3.0.1 jxmlease 1.0.3 lxml 4.6.4 MarkupSafe 2.0.1 ncclient 0.6.12 netaddr 0.8.0 packaging 21.2 paramiko 2.11.0 pip 22.0.2 pyaoscx 2.2.1 pycparser 2.21 PyNaCl 1.5.0 pyparsing 2.4.7 PyYAML 6.0 requests 2.28.1 resolvelib 0.5.4 setuptools 49.2.1 six 1.16.0 urllib3 1.26.10 xmltodict 0.12.0 WARNING: You are using pip version 22.0.2; however, version 22.2 is available. You should consider upgrading via the '/ws/chiapuzi/tme/sandbox/py3_ansible/bin/python3 -m pip install --upgrade pip' command.

(py3_ansible) ansible-control-machine$python3 --version Python 3.8.9 (py3_ansible) ansible-control-machine$ansible --version ansible [core 2.12.1] config file = /ws/chiapuzi/tme/sandbox/cx_playbooks/ansible.cfg configured module search path = ['/users/chiapuzi/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /ws/chiapuzi/tme/sandbox/py3_ansible/lib/python3.8/site-packages/ansible ansible collection location = /users/chiapuzi/.ansible/collections:/usr/share/ansible/collections executable location = /ws/chiapuzi/tme/sandbox/py3_ansible/bin/ansible python version = 3.8.9 (default, Apr 3 2021, 01:02:10) [GCC 5.4.0 20160609] jinja version = 3.0.1 libyaml = True (py3_ansible) ansible-control-machine$which python3 /ws/chiapuzi/tme/sandbox/py3_ansible/bin/python3 (py3_ansible) ansible-control-machine$ansible-galaxy collection list

/users/chiapuzi/.ansible/collections/ansible_collections

Collection Version


ansible.netcommon 2.4.0 ansible.posix 1.1.1 ansible.utils 2.3.1 arubanetworks.aos_switch 1.5.0 arubanetworks.aoscx 4.0.3

results_facts.txt

DonRhodes commented 2 years ago

I think there are multiple things happening here.

Using:

      aoscx_facts:
        gather_subset:
          - host_name
          - physical_interfaces
        gather_network_resources:
          - interfaces

I get ansible_network_resources -> interfaces and the fact data is there.

Using aoscx_facts: to gather all of the facts, or

    aoscx_facts:
      gather_subset: ['host_name','physical_interfaces','platform_name','product_info']

the ansible_net_interfaces tree is only reporting the top level.

tchiapuziowong commented 2 years ago

Ah okay I see it now - I'll forward this to the dev team and we'll look into it - thank you for working me with to figure out the issue! @DonRhodes

DonRhodes commented 2 years ago

Glad to help!

DonRhodes commented 2 years ago

To make this a big stranger, I noticed that a 6100 running the same code version does not have this issue.

    "ansible_net_software_images": {
    "boot_profile_timeout": 2,
    "default_image": "primary",
    "primary_image_date": "2022-07-18 23:44:21 UTC",
    "primary_image_sha_256": "c9c74ed1911b7952fe4f32d75f32b5b0dc1cabf70043611d7782d54443f8bf57",
    "primary_image_size": "308 MB",
    "primary_image_version": "PL.10.09.1040",

    "ansible_net_platform_name": "6100",
tchiapuziowong commented 1 year ago

Hello All! We've officially published the release of v4.1.1 of the AOS-CX Ansible collection, the fix for this issue as well as others were a part of the release so please install the latest version of the collection and our Python SDK using the commands below: ansible-galaxy collection install arubanetworks.aoscx -f pip3 install pyaoscx --upgrade

Please let us know if you discover any further issues or unwanted behavior and thank you again for your patience!

DonRhodes commented 1 year ago

Adding: ansible_host: ansible_aoscx_rest_version: 10.09

Has returned the facts.