Ansible adhoc command/playbook is not displaying output for the passed argument

Hi, I am just getting started with ansible and came across this issue. Ansible doesn’t print the output of the passed argument to the screen when using raw module for both adhoc command and playbook.

Here is what I see,

[root@localhost ~]$ ansible s1 -m raw -a ‘show ip interface brief’ -k

SSH password:
s1 | SUCCESS | rc=0 >>
Shared connection to switch closed.

NO OUTPUT is displayed for the “show ip interface brief” argument

[root@localhost ~]$ ansible-playbook test.yml -k
SSH password:

PLAY [Device Version] *********************************************************************************************************************************************************************************************

TASK [show version] ***********************************************************************************************************************************************************************************************
changed: [s1]

TASK [debug] ******************************************************************************************************************************************************************************************************
ok: [s1] => {
“print_output.stdout_lines”: []
} <–DOESN’T DISPLAY ANY OUTPUT

PLAY RECAP ********************************************************************************************************************************************************************************************************
s1 : ok=2 changed=1 unreachable=0 failed=0

root@ubuntu:~$ cat ansible.cfg

[defaults]

inventory = ./hosts

host_key_checking = false

timeout = 5

root@ubuntu:~$ cat hosts

s1 ansible_ssh_common_args=“-c 3des-cbc”

root@ubuntu:~$ cat test.yml

Based on the commands it seems you are trying to run commands that are meant to work with network devices.If that’s the case raw module does not work with network devices.

You need to set correct value of ansible_connection and use supported _command or _config
modules to run operational and configuration command respectively.
List of supported network modules: https://docs.ansible.com/ansible/2.5/modules/list_of_network_modules.html#network-modules

Also, please refer getting started guide for Ansible Network Automation https://docs.ansible.com/ansible/2.5/network/getting_started/index.html

for more details

Regards,
Ganesh

Hi Ganesh,

Thanks for suggesting me the right resources to get started with ansible automation for network devices. The problem is we run a multi-vendor environment and this particular issue only occurs with Dell Force10 devices running “Force10 Operating System”. I still wasn’t able to find an easy way to get them working, although they kind of work when using “dellos9” network module along with public key authentication. I need to do some more tests.

Sorry for the delayed response.

Regards,
Ajay

P.S. “raw” module works for some network devices although it has some limitations.