Make sure your host file entries resolve in DNS or just use the IP.
You can uncomment the term len 0 and show run commands and do the same.
root@127c868b9dd3:/ansible/ansible2_4_base# ansible-playbook -i hosts ios_telnet.yml
PLAY [cisco] ********************************************************************************************************************************
TASK [run show commands via Telnet] *********************************************************************************************************
changed: [arctic-sw01]
changed: [10.1.10.100]
TASK [debug] ********************************************************************************************************************************
ok: [arctic-sw01] => {
"output": {
"changed": true,
"failed": false,
"output": [
"show inventory\r\nNAME: \"arctic-sw01\", DESCR: \"Cisco Catalyst c2940 switch with 8 10/100 BaseTX ports and 1 10/100/1000 BaseT uplink port\"\r\nPID: WS-C2940-8TT-S , VID: D0 , SN: FHK0834Y19X\r\n\r\n\r\narctic-sw01#"
]
}
}
ok: [10.1.10.100] => {
"output": {
"changed": true,
"failed": false,
"output": [
"show inventory\r\nNAME: \"arctic-sw01\", DESCR: \"Cisco Catalyst c2940 switch with 8 10/100 BaseTX ports and 1 10/100/1000 BaseT uplink port\"\r\nPID: WS-C2940-8TT-S , VID: D0 , SN: FHK0834Y19X\r\n\r\n\r\narctic-sw01#"
]
}
}
TASK [copy] *********************************************************************************************************************************
changed: [arctic-sw01 -> localhost]
changed: [10.1.10.100 -> localhost]
PLAY RECAP **********************************************************************************************************************************
10.1.10.100 : ok=3 changed=2 unreachable=0 failed=0
arctic-sw01 : ok=3 changed=2 unreachable=0 failed=0
root@127c868b9dd3:/ansible/ansible2_4_base# cd facts/
root@127c868b9dd3:/ansible/ansible2_4_base/facts# ls
10.1.10.100.txt arctic-sw01.txt nxos-spine1.txt nxos-spine2.txt
root@127c868b9dd3:/ansible/ansible2_4_base/facts# cat 10.1.10.100.txt
show inventory
NAME: "arctic-sw01", DESCR: "Cisco Catalyst c2940 switch with 8 10/100 BaseTX ports and 1 10/100/1000 BaseT uplink port"
PID: WS-C2940-8TT-S , VID: D0 , SN: FHK0834Y19X
arctic-sw01#root@127c868b9dd3:/ansible/ansible2_4_base/facts
The only other approach I'm aware of is to use the NTC modules which use Napalm and the Cisco IOS modules use Netmiko under the hood which supports Telnet although last I checked I didn't think the Telnet option was exposed.
Note that the end goal of this module is to telnet to a device to enable SSH but I know that is sometimes not possible.