Cannot show output when using raw command in ansible

12 views
Skip to first unread message

Mac Kam

unread,
Aug 30, 2019, 1:49:54 AM8/30/19
to Ansible Project
HI friends,

When I use raw command in out remote router, then cannot show the output.
my ansible version:2.7.5

yaml:
- hosts: SSR
  gather_facts: no
  remote_user: user
  
 tasks:
  - name: run
    raw: "show port"
    register: result
 -name: Print output
  debug:
      msg: "{{result.stdout}}"


result:

unnamed.jpg

attached the screen capture.
      

Vladimir Botka

unread,
Aug 30, 2019, 2:15:52 AM8/30/19
to Mac Kam, ansible...@googlegroups.com
On Thu, 29 Aug 2019 22:49:54 -0700 (PDT)
Mac Kam <macka...@gmail.com> wrote:

> HI friends,
>
> When I use raw command in out remote router, then cannot show the output.
> [...]
> -name: Print output
> debug:
> msg: "{{result.stdout}}"

You can show the output. But the output is empty.

"stdout_lines": []

The command was silently ignored

"rc": 0
"stderr": "Shared connection to ... closed."

Ansible can't help you. Probably the router's doc could.

Cheers,

-vlado

Mac Kam

unread,
Aug 30, 2019, 3:40:02 AM8/30/19
to Ansible Project
Vladimir Botka於 2019年8月30日星期五 UTC+8下午2時15分52秒寫道:
Hi friends,

Any solution to solve the problem?
Thanks.
Reply all
Reply to author
Forward
0 new messages