Hi Srinivas,

Sure! I will update you.

This is just weird, I tried it on GNS3 and it is working. but on the prod 
itself, it is not. 

playbook is just straight forward:


---
- name: Telnet do show version for IOS
  hosts: Cisco_Telnet
  gather_facts: false
  connection: local

  tasks:
    - name: show version
      telnet:
        user: "{{ username }}"
        password: "{{ password }}"
        login_prompt: "Username:"
        prompts:
          - "[>|#]"
        command:
          - terminal length 0
          - show version


hostfile:

[Cisco_Telnet]
cisco_device    host=192.168.1.1   username=cisco password=cisco


On Monday, April 13, 2020 at 4:27:20 AM UTC-4, Srinivas Naram wrote:
>
> Some time back just to test telnet module, I tried telnet for devices 
> which had ssh as well as telnet access. However I was not successful and 
> gave up. If you get this working, kindly reply with the solution.
>
> Thanks
> Srinivas. 
>
> On Mon, Apr 13, 2020 at 1:44 PM Zaldy B <zaldy...@gmail.com <javascript:>> 
> wrote:
>
>> Hi Karl,
>>
>> Unfortunately, those devices that we have are old and uses telnet :)  
>>
>> But other devices which are SSH enabled are being automated by ansible 
>>
>> On Monday, April 13, 2020 at 4:05:53 AM UTC-4, Karl Auer wrote:
>>>
>>> Unless you have some specific reason for wanting to use telnet, the 
>>> obvious workaround is to use ssh instead....
>>>
>>> Regards, K.
>>>
>>>
>>> On Mon, Apr 13, 2020 at 5:51 PM Zaldy B <zaldy...@gmail.com> wrote:
>>>
>>>> Hi Karl,
>>>>
>>>> yes, I can connect to the device from my ansible server using telnet.  
>>>> I can also connect to the device using my putty (outside of ansible) using 
>>>> telnet.
>>>>
>>>>
>>>>
>>>> On Monday, April 13, 2020 at 3:23:36 AM UTC-4, Karl Auer wrote:
>>>>>
>>>>> Can you connect to your IOS devices normally, i.e. outside Ansible?
>>>>>
>>>>> If yes, then I have no idea what's going on, but if not, get that 
>>>>> working first before you try doing it with Ansible.
>>>>>
>>>>> Off the cuff theory is that the devices do not permit telnet 
>>>>> connections...
>>>>>
>>>>> Regards, K.
>>>>>
>>>>>
>>>>> On Mon, Apr 13, 2020 at 5:07 PM Zaldy B <zaldy...@gmail.com> wrote:
>>>>>
>>>>>> Hi Experts,
>>>>>>
>>>>>> I am just new with this one. I am trying to connect using telnet (ssh 
>>>>>> has no issue) to my IOS devices, but I am getting error when I run my 
>>>>>> playbook:
>>>>>> ------------------------------
>>>>>>
>>>>>>    - 
>>>>>>    
>>>>>>    name: Telnet do show version for IOS
>>>>>>    hosts: telnet_device
>>>>>>    gather_facts: false
>>>>>>    connection: local
>>>>>>    
>>>>>>    tasks:
>>>>>>    - name: show version
>>>>>>       telnet:
>>>>>>       user: cisco
>>>>>>       password: cisco
>>>>>>       login_prompt: "Username: "
>>>>>>       prompts:
>>>>>>       - "[>#]"
>>>>>>       command:
>>>>>>       - terminal length 0
>>>>>>       - show version
>>>>>>    
>>>>>> Error:
>>>>>> PLAY [Telnet do show version for IOS] 
>>>>>> ***********************************************************************************************************************
>>>>>>
>>>>>> TASK [show version] 
>>>>>> *****************************************************************************************************************************************
>>>>>> fatal: [telnet_device]: FAILED! => {"changed": true, "msg": "Telnet 
>>>>>> action failed: telnet connection closed", "output": []}
>>>>>>
>>>>>> PLAY RECAP 
>>>>>> **************************************************************************************************************************************************
>>>>>> telnet_device : ok=0 changed=0 unreachable=0 failed=1 skipped=0 
>>>>>> rescued=0 ignored=0
>>>>>>
>>>>>>
>>>>>>
>>>>>> Any suggestions/comments is much appreciated.
>>>>>>
>>>>>> -- 
>>>>>> 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...@googlegroups.com.
>>>>>> To view this discussion on the web visit 
>>>>>> https://groups.google.com/d/msgid/ansible-project/60dd5a69-5a23-4c53-9bcf-08e5e8df6b44%40googlegroups.com
>>>>>>  
>>>>>> <https://groups.google.com/d/msgid/ansible-project/60dd5a69-5a23-4c53-9bcf-08e5e8df6b44%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>>
>>>>>
>>>>>
>>>>> -- 
>>>>>
>>>>> *Karl Auer* { manager, systems support }
>>>>> P: 1300 759 975
>>>>> E: ka...@2pisoftware.com
>>>>> 2pisoftware.com
>>>>>
>>>>> GPG/PGP : DF6A 43E5 FB9D D884 C6CA CD7F 5278 212D E80F C107
>>>>> Previous: 301B 1F4E 624D AD99 242C 7A68 EC24 7113 E854 4A4E
>>>>>
>>>> -- 
>>>> 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...@googlegroups.com.
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/ansible-project/77abad3c-b5ad-45c5-a2e2-d5e8331f73b6%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/ansible-project/77abad3c-b5ad-45c5-a2e2-d5e8331f73b6%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>>
>>>
>>> -- 
>>>
>>> *Karl Auer* { manager, systems support }
>>> P: 1300 759 975
>>> E: ka...@2pisoftware.com
>>> 2pisoftware.com
>>>
>>> GPG/PGP : DF6A 43E5 FB9D D884 C6CA CD7F 5278 212D E80F C107
>>> Previous: 301B 1F4E 624D AD99 242C 7A68 EC24 7113 E854 4A4E
>>>
>> -- 
>> 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...@googlegroups.com <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/6c9852f6-30a6-4326-b29a-d2d354a947f8%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/ansible-project/6c9852f6-30a6-4326-b29a-d2d354a947f8%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/4d8a1966-9547-44d7-8a19-6fd2bbaa2f20%40googlegroups.com.

Reply via email to