vagrant and ansible provisionning fails with INFO interface: error: The Ansible software could not be found! Please verify that Ansible is correctly installed on your host system.

316 views
Skip to first unread message

Jean-Luc Pinardon

unread,
Jan 11, 2018, 5:33:36 AM1/11/18
to Vagrant
Dear all,

I am new to vagrant and ansible, and I am currently making some trials.
My host environment is a WIndows 7 machine (sorry) with cygwin64.
Ansible and Vagrant are both installed :
$ ansible --version  &&  vagrant --version
ansible
2.4.2.0
  config file
= None
  configured
module search path = ['/home/jeanlupi/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python
module location = /usr/lib/python3.6/site-packages/ansible
  executable location
= /usr/bin/ansible
  python version
= 3.6.3 (default, Oct 31 2017, 19:00:36) [GCC 6.4.0]
Vagrant 2.0.1


At the moment, I know how to create a Vagrantfile, have a brand new VM automatically created with Vagrant, and access it through ssh.
Also, I succeed in using an ansible playbook to provision this new VM.
So, each vagrant and ansible can run correctly when launched one by one.

Now, I want to make it to work together using config.vm.provider. But it fails with the following trace :
 INFO provision: Writing provisioning sentinel so we don't provision again
 INFO interface: info: Running provisioner: ansible...
 INFO interface: info: ==> default: Running provisioner: ansible...
==> default: Running provisioner: ansible...
 INFO environment: Running hook: provisioner_run
 INFO runner: Preparing hooks for middleware sequence...
 INFO runner: 1 hooks defined.
 INFO runner: Running action: provisioner_run #<Method: Vagrant::Action::Builtin::Provision#run_provisioner>
 INFO warden: Calling IN action: #<Proc:0x0000000004b69578@C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.1/lib/vagrant/action/warden.rb:94 (lambda)>
 INFO subprocess: Starting process: ["C:/Program Files/Oracle/VirtualBox/VBoxManage.exe", "showvminfo", "2ace896f-293d-442b-9c62-bb8281960435", "--machinereadable"]
 INFO subprocess: Command not in installer, restoring original environment...
 INFO subprocess: Starting process: ["C:/Program Files/Oracle/VirtualBox/VBoxManage.exe", "showvminfo", "2ace896f-293d-442b-9c62-bb8281960435", "--machinereadable"]
 INFO subprocess: Command not in installer, restoring original environment...
 INFO interface: warn: Windows is not officially supported for the Ansible Control Machine.
Please check https://docs.ansible.com/intro_installation.html#control-machine-requirements

Windows is not officially supported for the Ansible Control Machine.
Please check https://docs.ansible.com/intro_installation.html#control-machine-requirements
ERROR ansible_host: Error while gathering the ansible version: The Ansible software could not be found! Please verify
that Ansible is correctly installed on your host system.

So, it incorrectly says that "The Ansible software could not be found!", and I don't clearly understand why it claims that "Windows is not officially supported for the Ansible Control Machine", though ansible clearly runs correctly.

For information :
The Vagrantfile is :
Vagrant.configure(2) do |config|
  config
.vm.box = "geerlingguy/centos7"
  config
.vm.network "forwarded_port", guest: 8080, host: 8080
  config
.vm.synced_folder "../", "/var/data",create: true
  config
.vm.provider "virtualbox" do |v|
   
# Add a name
    v
.name="CI_Env"
   
# Add enough memory
    v
.memory = 4048
 
end
  config
.vm.provision :ansible do |ansible|
    ansible
.playbook="../ansible/configure-ci-server.yml"
    ansible
.tags=["geerlingguy.java","git"]
 
end
end

And the directory tree is :
$ tree -d -L 3 .
.
├── ansible
  └── roles
      ├── geerlingguy.java
      ├── geerlingguy.jenkins
      ├── git
      └── LTS-2_89.jenkins
├── doc
├── etc
├── tools
├── Vagrant


Thanks in advance for your help.
Best Regards
J-L

Alvaro Miranda Aguilera

unread,
Jan 11, 2018, 7:05:58 AM1/11/18
to vagra...@googlegroups.com
can you put this into a github repo and share?


--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/37104476-637e-4190-9ad2-f603509b96b7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Jean-Luc Pinardon

unread,
Jan 11, 2018, 9:15:21 AM1/11/18
to Vagrant
Ok, I put it there :
https://github.com/JiElPe-Fr38/myKnowledge.git

Note that I have sligthly modified the directory tree and the Vagrantfile according to this Vagrant documentation page, and assuming that I needed to pass the same parameters as when running manually ansible.

Thanks for your help.
J-L

Alvaro Miranda Aguilera

unread,
Jan 11, 2018, 10:53:18 AM1/11/18
to vagra...@googlegroups.com
you can use ansible_local that runs in the guest.

and there was couple of typos in one for the files..


you can test mine here:

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Jean-Luc Pinardon

unread,
Jan 11, 2018, 12:43:42 PM1/11/18
to Vagrant
Well... that's not what I wanted to do... But never mind, I tried with ansible_local.
It automatically installs ansible on the guest and run it.
Ok, ansible runs on the guest, but it fails with a :

PLAY [Configure CI server] *****************************************************
skipping
: no hosts matched

error.

It means that it actually try to run the playbook, but it can find the server where to run it.
As it runs on the guest, I have tried to run the playbook directly on the guest.
==> Same error.
So, I have changed the hosts line of the playbook to hosts: localhost.
.
Running it again from the guest, it worked !
So far so good, I therefor changed to localhost within the playbook on the host and redo from scratch.
But I retrieved the error again.
... and have no idea why...

Thanks again for your help, and have a good evening.
Best regards
J.L.P.


Le jeudi 11 janvier 2018 11:33:36 UTC+1, Jean-Luc Pinardon a écrit :

Alvaro Miranda Aguilera

unread,
Jan 11, 2018, 4:18:08 PM1/11/18
to vagra...@googlegroups.com
yeah no idea why, i tried localhost, change name etc, so i went for host: all to get it running

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Reply all
Reply to author
Forward
0 new messages