Hi
is there a way to have a nicer output from Ansible if you do a "show network" on a IAP via REST API ? At the moment it looks like this.
And you have to use the ugly "-v" extension on the command to get any output at all.
ansible-playbook play.yml -i /etc/ansible/hosts -v
Using /etc/ansible/ansible.cfg as config file
PLAY [Show existing network] **********************************************************************************************************************************************************************************************************************************************
TASK [Show existing network as a show command through API] ****************************************************************************************************************************************************************************************************************
[WARNING]: Module did not set no_log for password
[WARNING]: Platform linux on host 192.168.100.31 is using the discovered Python interpreter at /usr/bin/python, but future installation of another Python interpreter could change this. See
https://docs.ansible.com/ansible/2.9/reference_appendices/interpreter_discovery.html for more information.
changed: [192.168.100.31] => changed=true
ansible_facts:
discovered_interpreter_python: /usr/bin/python
msg: '{u''Status'': u''Success'', u''CLI Command executed'': u''show network
'', u''IAP IP address'': u''192.168.100.31'', u''Command output'': u''cli output:
COMMAND=show network
\r
Networks
--------
Profile Name ESSID Clients Type Band Authentication Method Key Management IP Assignment Status Zone Coding Active Max IPv4 Users
------------ ----- ------- ---- ---- --------------------- -------------- ------------- ------ ---- ------ ------ --------------
SetMeUp SetMeUp-C1:AE:C5 0 employee 2.4 None none NAT Mode Enabled - Default Yes N/A'', u''Status-code'': 0}'
status_code: 200
my playbook looks like this.
- name: Show existing network
hosts: aruba_ap315
connection: local
gather_facts: no
tasks:
- name: Show existing network as a show command through API
arubainstant_config:
host: 192.168.100.31
username: admin
password: admin
method: GET
iap_ip_addr: 192.168.100.31
api_type: monitoring
api_name: show network
what i wan to have is:
show network
Networks
--------
Profile Name ESSID Clients Type Band Authentication Method Key Management IP Assignment Status Zone Coding Active Max IPv4 Users
------------ ----- ------- ---- ---- --------------------- -------------- ------------- ------ ---- ------ ------ --------------
SetMeUp SetMeUp-C1:AE:C5 0 employee 2.4 None none NAT Mode Enabled - Default Yes N/A
Tried to use a register variable and output.stdout it but register is not supported by this module .
Regards Markus