community.network icon indicating copy to clipboard operation
community.network copied to clipboard

Issues with aruba_command module when running against Mobility Conductor

Open rtorres-github opened this issue 1 year ago • 1 comments

SUMMARY

Issues with aruba_command module when running against Mobility Conductor. I can run the CLI commands against a Managed Device (Aruba Gateways) running version 8.10.0.6 but unable to do so on the Mobility Conductor. I get the following error "Unable to decode JSON from response to exec_command({"command": "show version", "prompt": null, "answer": null}). Received 'None'."

ISSUE TYPE
  • Bug Report
COMPONENT NAME

module: aruba_command ansible_connection: "network_cli" ansible_network_os: "aruba"

Overwrite the applied role in the task with the networkcli and aruba ansible connection and network os listed above

ADDITIONAL INFORMATION

Task is to run show commands against the Mobility Conductor and Managed Devices

- name: aruba controller browse
  hosts: "{{ device_name }}"
  roles:
    - role: arubanetworks.aos_wlan_role
  gather_facts: no
  vars:
    device_name: ""
    command_list: ""

  tasks:

    - name: show commands
      community.network.aruba_command:
        commands: "{{ item }}"
      loop: "{{ command_list }}"
      register: command_output

    - debug:
        var: command_output

    - name: print results
      run_once: yes
      debug:
        msg: "{{ lookup('template', 'command_output.j2').split('\n') }}"

command_output.j2 file:

==============
Results:
==============
{% for host in ansible_play_hosts %}
------------------------
Hostname: {{ host }}
------------------------

{% for output in hostvars[host]['command_output']['results'] %}
/// {{ host }} - {{ output['item'] }}

{{ output['stdout'][0] }}

{% endfor %}
{% endfor %}
COMMANDS TO TEST

show ap active show ap database show ap database-summary show clock show cpuload show debug show image version show ip interface brief show ip route show logging level verbose show memory show configuration received show storage show switch ip show version show vlan show lc-cluster group-membership show switches

rtorres-github avatar Jun 06 '23 17:06 rtorres-github