Following the official Ubuntu guide (http://docs.ansible.com/intro_installation.html#latest-releases-via-apt-ubuntu) I experienced the following problem:
$ ansible --version
ansible 1.9
configured module search path = None
$ ansible all -m ping
nas | FAILED => module ping not found in configured module paths. Additionally, core modules are missing. If this is a checkout, run ‘git submodule update --init --recursive’ to correct this problem.
Where could I find the default modules like ‘ping’?
The /usr/share/ansible directory is empty,
The /etc/ansible directory contains only the ansible.cfg and the hosts file (I already modified the latter and added my ‘nas’).
The ~/.ansible cotains only an empty directory called cp
If I run the suggested command, it says:
$ git submodule update --init --recursive
fatal: Not a git repository (or any of the parent directories): .git
So: where are the default modules or how can I get them?
I’m on Ubuntu 14.04
Regards:
Bence
I just built a Ubuntu 14.04 VM, and went through the same procedures. It installed Ansible 1.8.2, not 1.9.
user@ubuntu:~$ uname -a
Linux ubuntu 3.13.0-43-generic #72-Ubuntu SMP Mon Dec 8 19:35:06 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
user@ubuntu:~$ dpkg -l | grep -i ansible
ii ansible 1.8.2-1ppa~trusty all A radically simple IT automation platform
user@ubuntu:~$
Check /usr/share/pyshared/ansible, thats where everything was installed for me. Maybe try reinstalling?
Jay
Now I see what is the main issue: first I tried to install ansible from source (I found a howto about that first…)
And it has no ‘remove’ or ‘uninstall’ build target. So I just deleted the directories I found…
Now I tried some stronger cleanup:
sudo apt-get remove ansible
sudo pip uninstall ansible
I also have some remainings:
$ whereis ansible
ansible: /etc/ansible /usr/local/bin/ansible
How should I remove those?
Regards:
Bence
- december 20., szombat 11:31:33 UTC+1 időpontban Bence Takács a következőt írta:
I deleted the remaining files from /usr/local/bin and reinstalled ansible with apt-get again, but something is wrong:
$ ansible all -m ping
bash: /usr/local/bin/ansible: No such file or directory
Any tips?
- december 21., vasárnap 18:29:24 UTC+1 időpontban Bence Takács a következőt írta:
Seems like you still need some more cleanup to do. Apt-get remove it, then remove everyone ansible on your system, including any .ansible.cfg or .ansible directories, and anything left in /usr/local and /etc. And then do a fresh install from scratch and see if that helps. Make sure you don’t have any ANSIBLE environment variables set the old paths too.
Jay
According to my understanding I exactly did everything you suggested in the previous step.
Then installed it again.
The result is:
$ ansible all -m ping
bash: /usr/local/bin/ansible: No such file or directory
But it seems that this works:
sudo ansible all -m ping
… or at least it initiates the ssh session but does not find the keys… since it is looking for them in ‘/root/.ssh’ instead of my user’s directory.
Is that the desired behaviour, that ansible could be run only by root (on Ubuntu)?
- december 21., vasárnap 19:02:12 UTC+1 időpontban titlei...@gmail.com a következőt írta:
Ok, after deleting the form /etc/ansible/ansible.cfg
and reinstalling again, everything is working with the ‘normal’ user, without sudo
Thanks
- december 20., szombat 11:31:33 UTC+1 időpontban Bence Takács a következőt írta:
Sounds like you had an old config file pointed at the source install. Glad it’s working now.
Jay