# 'ERROR!' Telnet 'is not a valid attribute to play

**URL:** <https://forum.ansible.com/t/error-telnet-is-not-a-valid-attribute-to-play/29394>\
**Category:** Ansible Project\
**Created:** [January 8, 2019, 6:54pm UTC](https://forum.ansible.com/t/error-telnet-is-not-a-valid-attribute-to-play/29394 "2019-01-08T18:54:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eduardo\_Nunes\_Pereir](https://avatars.discourse-cdn.com/v4/letter/e/85e7bf/32.png) [@Eduardo\_Nunes\_Pereir](https://forum.ansible.com/u/Eduardo_Nunes_Pereir)\
**Post date:** [January 8, 2019, 6:54pm UTC](https://forum.ansible.com/t/error-telnet-is-not-a-valid-attribute-to-play/29394/1 "2019-01-08T18:54:58Z")

</div>

Hello Everyone,

I use ansible 2.7, I’m trying to use the ‘telnet’ module to connect to Cisco devices with IOS but it has the following error: ‘\*\*ERROR!’ Telnet 'is not a valid attribute to play "\*\*any ideas?

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [January 8, 2019, 8:38pm UTC](https://forum.ansible.com/t/error-telnet-is-not-a-valid-attribute-to-play/29394/2 "2019-01-08T20:38:31Z")

</div>

You playbook is wrong.

---

<div class="post-metadata">

**Author:** ![goforawalktwice](https://avatars.discourse-cdn.com/v4/letter/g/c5a1d2/32.png) [@goforawalktwice](https://forum.ansible.com/u/goforawalktwice)\
**Post date:** [January 9, 2019, 12:42am UTC](https://forum.ansible.com/t/error-telnet-is-not-a-valid-attribute-to-play/29394/3 "2019-01-09T00:42:32Z")

</div>

Hi, it would help to paste your playbook here. Invoking tasks from a playbook requires specific syntax - one option is under ‘tasks’ - see [https://docs.ansible.com/ansible/latest/user\_guide/playbooks\_intro.html](https://docs.ansible.com/ansible/latest/user_guide/playbooks_intro.html)  
Alternately you can have your tasks in a role and call the role from your playbook. Hope that helps. Regards, Straff

---

<div class="post-metadata">

**Author:** ![Eduardo\_Nunes\_Pereir](https://avatars.discourse-cdn.com/v4/letter/e/85e7bf/32.png) [@Eduardo\_Nunes\_Pereir](https://forum.ansible.com/u/Eduardo_Nunes_Pereir)\
**Post date:** [January 9, 2019, 11:29am UTC](https://forum.ansible.com/t/error-telnet-is-not-a-valid-attribute-to-play/29394/4 "2019-01-09T11:29:49Z")

</div>

Hi,

First of all thanks for the answers, below is my playbook and then the error message.

## Playbook

- name: Coletct Information Switches  
connection: network\_cli  
gather\_facts: false  
hosts: lab\_telnet  
tasks:

- name: send configuration commands to IOS  
telnet:  
user: admin  
password: xxxx  
login\_prompt: "Username: "  
prompts:

- “[\>|#]”  
command:

- terminal length 0

- show run

# Error message

root@DESKTOP-5B1T804:/etc/ansible# ansible-playbook telnet.yml  
ERROR! ‘telnet’ is not a valid attribute for a Play

The error appears to have been in ‘/etc/ansible/telnet.yml’: line 8, column 3, but may  
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

- name: send configuration commands to IOS  
^ here

---

<div class="post-metadata">

**Author:** ![Karl\_Auer](https://avatars.discourse-cdn.com/v4/letter/k/cc9497/32.png) [@Karl\_Auer](https://forum.ansible.com/u/Karl_Auer)\
**Post date:** [January 9, 2019, 11:39am UTC](https://forum.ansible.com/t/error-telnet-is-not-a-valid-attribute-to-play/29394/5 "2019-01-09T11:39:03Z")

</div>

Please repost using a fixed width font so we can check your indentation. Make sure you post your ENTIRE playbook.

Also, YAML code should always start with three hyphens on a line by themselves.

Regards, K.

---

<div class="post-metadata">

**Author:** ![Tchia04](https://avatars.discourse-cdn.com/v4/letter/t/fbc32d/32.png) [@Tchia04](https://forum.ansible.com/u/Tchia04)\
**Post date:** [January 9, 2019, 2:48pm UTC](https://forum.ansible.com/t/error-telnet-is-not-a-valid-attribute-to-play/29394/6 "2019-01-09T14:48:39Z")

</div>

I believe you need to have two spaces indentation for the telnet task
