NameError: name 'ansible' is not defined

804 views
Skip to first unread message

Karthik Rengarajan

unread,
Aug 10, 2015, 2:50:51 PM8/10/15
to Ansible Project
Hi, I am new to ansible and learning ansible from a tutorial. I am using windows 7 (unfortunately) and Vagrant with VirtualBox. I have installed ansible 2.0.0 on one vagrant ubuntu box and the ansible inventory file has an entry for another ubuntu vagrant box. 

When running 'ansible all -m ping' it returns with success message however when executing the 'ansible-playbook <playbook-name>' it returns with the below error. Can you please advise if I am missing something.

Traceback (most recent call last):
  File "/usr/local/bin/ansible-playbook", line 5, in <module>
    pkg_resources.run_script('ansible==2.0.0', 'ansible-playbook')
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 528, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1394, in run_script
    execfile(script_filename, namespace, namespace)
  File "/usr/local/lib/python2.7/dist-packages/ansible-2.0.0-py2.7.egg/EGG-INFO/scripts/ansible-playbook", line 1, in <module>
    ansible
NameError: name 'ansible' is not defined

ra...@ioraecological.com

unread,
Apr 21, 2016, 11:01:44 AM4/21/16
to Ansible Project
Hello,

I am currently stuck here only.
I am also doing it in windows only.
Did u find any solution.

Any help will be appreciated.

Regards,
Rahul Pandia

Vlad Gorbunov

unread,
Jul 5, 2016, 8:44:29 AM7/5/16
to Ansible Project
Windows can't make correct symlinks. Do this:
cd /usr/local/lib/python2.7/
dist-packages/ansible-2.0.0-py2.7.egg/EGG-INFO/scripts
cp ansible ansible-playbook
cp ansible ansible-console
cp ansible ansible-doc
cp ansible ansible-galaxy
cp ansible ansible-pull
cp ansible ansible-vault
Reply all
Reply to author
Forward
0 new messages