-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ERROR! 'ntc_show_command' is not a valid attribute for a Play #94
Comments
Hi @spirrello Your It needs to look like this (using a different format for readability):
Don't have the IP address in curly braces...curly braces mean it's a variable. You also need an inventory file with at least one host in. Given your example it could look like this:
And if you didn't set your env variable for the inventory file, when you run it, it should be:
|
I'll try this out today. Thanks for the quick response! On Thu, Jan 14, 2016 at 5:43 PM, Jason Edelman notifications@github.com
|
Here's the error I'm getting now and I've copied the textfsm.py script in Am I do something else wrong? damac:ntc-ansible SPirrello$ ansible-playbook -i inventory_hostname PLAY [GET STRUCTURED DATA BACK FROM CLI DEVICES] TASK [GET VLANS IN REAL TIME] fatal: [10.159.129.2]: FAILED! => {"changed": false, "failed": true, "msg": PLAY RECAP 10.159.129.2 : ok=0 changed=0 unreachable=0 failed=1 damac:ntc-ansible SPirrello$ cat get_vlan.yml
damac:ntc-ansible SPirrello$ cat inventory_hostname [nexus] On Thu, Jan 14, 2016 at 5:43 PM, Jason Edelman notifications@github.com
|
This module requiresTextFSM. You can install with pip If you don't have pip, you can run these 4 commands first.
|
Finally got it working. For some reason when I did the pip instsall for /usr/lib/python2.6/site-packages/textfsm-0.2.2-py2.6.egg/ I appreciate your responses and keep the network automation movement going! On Sun, Jan 17, 2016 at 10:22 AM, Jason Edelman notifications@github.com
|
Awesome. |
I also find that after pip install gtextfsm there is below error: root@fa1390b85b25:/opt/ansible/ansible/ntc-ansible# ansible-playbook -i hosts myTest.yml PLAY [GET STRUCTURED DATA BACK FROM CLI DEVICES] ******************************* TASK [GET VLANS IN REAL TIME] ************************************************** PLAY RECAP ********************************************************************* root@fa1390b85b25:/opt/ansible/ansible/ntc-ansible# pip list the textfsm(0.2.1) has been installed but ntc_show_command can't find textfsm ? this is myTest.yml
|
Can you give more background on the machine? OS, version of Python, etc. Also, are you using the pre-built container or your own image? Can you also go into a Python shell and try to import textfsm?
|
I have found the root cause : in my environment , it's lost terminal module Thank a lot. |
I know this is old but I tried installing gtextfsm and terminal using pip. Both are already there but I still get the error:
Here is my pip list:
My playbook looks like this:
I am running RHEL 6 with Python 2.7.8. I am invoking my playbook as normal like this:
My inventory file is being derived from .ansible.cfg |
Just checking in to see if anyone has ran into the same issue I am having based on the playbook I have defined. |
Error the same as unix4linux |
i am having same error as well, while all above packages are installed. I am using RHEL 7.3 and python 2.7.12, hopefully this will be fixed soon |
I am having the same issue. RHEL 7.3 and Python 2.7.13. Running in a virtualenv. |
Hi,
After cloning ntc-ansible, i tried to launch the following playbook using the example provided but I'm getting the following error. Can you help?
$ ansible-playbook get_vlan.yml
[WARNING]: provided hosts list is empty, only localhost is available
ERROR! 'ntc_show_command' is not a valid attribute for a Play
The error appears to have been in '/Users/SPirrello/Google Drive/Work/scripts/ntc-ansible/get_vlan.yml': line 2, column 3, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
^ here
$ cat get_vlan.yml
connection=ssh
platform=cisco_nxos
command='show vlan'
host={{ 10.192.1.1 }}
username={{ my_login }}
password={{ my_password }}
The text was updated successfully, but these errors were encountered: