79323367

Date: 2025-01-02 10:07:17
Score: 0.5
Natty:
Report link

I found a solution.

This ansible module will check for login prompt regardless of the "login_prompt" option presence.

I had to provide empty options to make it work, here is the playbook:

---
- hosts: localhost
  connection: local
  gather_facts: false
  vars:
    telnet_link: "x.x.x.200"
    telnet_port: "5001"
  tasks:
    - name: Configure Static IP via Telnet
      ansible.netcommon.telnet:
        host: "{{ telnet_link }}"
        port: "{{ telnet_port }}"
        crlf: true
        send_newline: true
        login_prompt: ""
        user: ""
        password_prompt: ""
        password: ""
        prompts:
          - '[alpine:~#]'
        command:
          - echo "ok"

Happy New Year !

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: ARC ADBoo