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 <[email protected]> 于2018年10月25日周四 上午3:11写道: > > Look at the example for out-of-band on > https://docs.ansible.com/ansible/latest/modules/shell_module.html#shell-module > > > On Wed, Oct 24, 2018 at 1:53 PM Dongxian Yao <[email protected]> wrote: >> >> Hi Rong, >> >> do you have any updates on this one? did you write a new module you can >> share? >> >> Thanks! >> Don >> >> On Thursday, February 16, 2017 at 1:36:24 AM UTC-5, rong zhao wrote: >>> >>> 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写道: >>>> >>>> On Tue, 14 Feb 2017, rong zhao wrote: >>>> >>>> > 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? >>>> >>>> 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 >> >> -- >> 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 [email protected]. >> To post to this group, send email to [email protected]. >> 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 - > > -- > 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 > [email protected]. > To post to this group, send email to [email protected]. > 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. > For more options, visit https://groups.google.com/d/optout. -- 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 [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAOHr083%3DOV3NSm9uQ4O-9-cPeXz3-h5DJQVXcW0fi79TuXLP1g%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
