Could ansile access remote hosts by serial console over LAN

787 views
Skip to first unread message

rong zhao

unread,
Feb 14, 2017, 1:20:35 PM2/14/17
to Ansible Project
Hi Dears,
   My remote hosts' management port is serial console over LAN.
   When connect by ssh manually, I use ops account connect to remote hosts, and then it become the Linux console, I just run ssh command. 

   Now, I use ansible -m ping to test reachable, it reports:
   "Authentication or permission failure. In some cases, you may have been able to authenticate and did not have permissions on the remote directory. Consider changing the remote temp path in ansible.cfg to a path rooted in ...."

   yes, it should report this error, because this is not real ssh session, it is console.

   is there any method to modify the reachable test command? or do you have any suggestion for serial console over LAN?
Thanks. 

Dag Wieers

unread,
Feb 15, 2017, 7:55:40 AM2/15/17
to Ansible Project
Ansible expects to run python scripts remotely, so it requires a transport
(SSH) and the ability to run python.

In your case I assume you connect over SSH to an out-of-band management
board (using its own credentials) then get a serial console and then you
have to log on again on the console prompt.

This is not supported by Ansible at the moment, but is not impossible to
implement. Although there are pitfalls you have to consider (eg. someone
already logged in on that same console, or not having properly logged out
due to unexpected disconnect).

--
Dag

rong zhao

unread,
Feb 16, 2017, 1:36:24 AM2/16/17
to Ansible Project
Yes, you said totally right, it is exactly my problem. I have tried your suggestion, someone already logged on that same console.

but ansible still reports Authentication or permission failure. 

now, I want to study ansible's source code, try to rewrite the code after initial connection. it should send a 'enter' key, and try to login if the console is not logged on.

thank you for your help, I will update my trial later.

在 2017年2月15日星期三 UTC+8下午8:55:40,Dag Wieers写道:

Dongxian Yao

unread,
Oct 24, 2018, 2:53:24 PM10/24/18
to Ansible Project
Hi Rong,

do you have any updates on this one? did you write a new module you can share?

Thanks!
Don

Andrew Latham

unread,
Oct 24, 2018, 3:11:41 PM10/24/18
to ansible...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/787f74d8-9e9e-4abe-ad7b-a574a3832366%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
- Andrew "lathama" Latham -

rong zhao

unread,
Oct 25, 2018, 1:50:52 AM10/25/18
to ansible...@googlegroups.com
Hi Don,
Hm.. finally, I wrote a python script which reads jinja2 commands
template to generate shell commands and run generated commands by
pyexpect.

Then, run this python script on ansible controller host, we have
several ways to do that, similar with the method mentioned by Andrew
above, or using local_action to call the python script.

Thanks.
Andrew Latham <lat...@gmail.com> 于2018年10月25日周四 上午3:11写道:
> You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/KO-mkKnW6Tk/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to ansible-proje...@googlegroups.com.
> To post to this group, send email to ansible...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CA%2Bqj4S_2SvYPZ%3DA-GnMOjmfo-YvcnSTh2BjCTzUe_ktvxz8xCw%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages