On Tuesday, 13 March 2018 21.05.41 CET Samuel Sutton wrote:
> 
> Hey Kai,
> 
> 
> Thanks for the reply. Is the same thing happening with expect playbook that
> I made to try to telnet?

No, telnet is interactive, the problem you have now is wrong syntax.


> ---
> - hosts: localhost
>   connection: local
>   gather_facts: false
> 
> 
>   tasks:
>     - name: Expect Attempt
>       expect:
>         echo: yes
>         command: telnet 10.233.82.7 2033
>         responses:
>           Question:
>             - Connected to port* "echo"
>             - login: "admin"
>             - Password: "password"

Question is the text/prompt/question you are checking for, it's not a directive 
for the expect module.

    - name: Expect Attempt
      expect:
        echo: yes
        command: telnet 10.233.82.7 2033
        responses:
          login: "admin"
          Password: "password"

When expect sees login in the output it will type admin and press ENTER and 
type password when it sees Password or password since the expect module is case 
insensitive by default.
I don't understand what you tried to do with 'Connected to port* "echo"'

You should also check out this tread for just a few days ago that address the 
same problem you are having now.
https://groups.google.com/forum/#!topic/ansible-project/Cq1NhB98vQA


-- 
Kai Stian Olstad

-- 
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-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/1613022.vsV65v2571%40x1.
For more options, visit https://groups.google.com/d/optout.

Reply via email to