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