Was wondering how to best utilize telnet, rather than SSH, with ansible. We are using a Lantronix term server, and must telnet into individual ports.

More specifically, would it be best to use a specific telnet module? If so, which is most intuitive. Alternatively, is it more efficient to simply modify connection type within the hosts file / YAML playbook?

  • What did you try? Please add the attempts to the question.
    – 030
    Feb 26, 2018 at 19:24
  • Lantronix? Please provide more details. Why are you using this? Lantronix term server, and must telnet into individual ports
    – 030
    Feb 26, 2018 at 19:25
  • Why are you considering ansible?
    – 030
    Feb 26, 2018 at 19:26

2 Answers 2


As documented here, ansible does not support telnet as connection plugin. This means you cannot use ansible to connect to a remote machine via telnet and execute any of the ansible modules.

However, you can use connection: local for local connection(run ansible against the machine that is running it) and send telnet commands from the machine where ansible runs.

Example playbook will look something like that:

- hosts: localhost
  connection: local
  gather_facts: false

    - name: my first telnet task
        username: user
        password: pass
          - my command
  • Where are you specifying the remote device that you are telneting to? It looks like you are just telneting the localhost.
    – frakman1
    Oct 15, 2020 at 23:34
  • nowhere; If you read carefuly I say "Example playbook will look something like that:"; Nowhere I even try to suggest a remote connection. I don't understand your question?
    – man0v
    Oct 17, 2020 at 16:51

Ansible provides a module for telnet provisioning. See:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.