Vagrant and Ansible with Windows Hosts

2,619 views
Skip to first unread message

frantishrek

unread,
Apr 23, 2013, 9:19:07 AM4/23/13
to Vagrant
Hi,

I am running Vagrant on Windows (sorry). I am trying to use Ansible provisionner.

Vagrant returns this error :
"The "ansible-playbook" program could not be found! Please verify
that "ansible-playbook" is available on the PATH of your host
system, and try again.

If you haven't installed Ansible yet, please install Ansible
on your system. Vagrant can't do this for you in a safe, automated
way. Please see ansible.cc for more info."

First, I thought I have to installed Ansible on my guest (Ubuntu precise) but it did not resolve the problem.
I need to install Ansible on my host (sad).

I have tried to install Ansible following (http://ansible.cc/docs/gettingstarted.html) with pip and from sources with no success.
Can someone give me any clues ?
Do you plan to support Ansible like Puppet or chef (with execution directly on the guest) ? It will avoid to install Ansible on the host (but on the guest) ?

Thanks,

Fran'

Mike

unread,
Apr 23, 2013, 9:32:38 AM4/23/13
to vagra...@googlegroups.com
I think a key difference here is that Ansible differs from Puppet and
Chef in its execution model.

Both Puppet and Chef rely on code living on the target machine to
execute. Ansible seems to work solely over SSH.
Puppet and Chef marshall the executable code (catalogs, cookbooks) and
ship them to the target, and tell the target to execute with these
parameters.

Ansible's model seems to need to have all assets stored locally (on
your host) and then ship & execute on the target via SSH sessions, vs
the Puppet/Chef model where you don't need them installed on the host
at all.

Admittedly, I have not read the Vagrant-Ansible integration yet, but I
can conceive how this would be more divergent from the current
provisioners.

-M
> --
> 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+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

frantishrek

unread,
Apr 23, 2013, 10:09:03 AM4/23/13
to Vagrant

2013/4/23 Mike <miket...@gmail.com>

I think a key difference here is that Ansible differs from Puppet and
Chef in its execution model.

Both Puppet and Chef rely on code living on the target machine to
execute. Ansible seems to work solely over SSH.
Puppet and Chef marshall the executable code (catalogs, cookbooks) and
ship them to the target, and tell the target to execute with these
parameters.

Ansible's model seems to need to have all assets stored locally (on
your host) and then ship & execute on the target via SSH sessions, vs
the Puppet/Chef model where you don't need them installed on the host
at all.

Admittedly, I have not read the Vagrant-Ansible integration yet, but I
can conceive how this would be more divergent from the current
provisioners.


Thanks for your answer.
Yes, you are right.
I have read Vagrant-Ansible integration (https://github.com/mitchellh/vagrant/blob/master/plugins/provisioners/ansible/provisioner.rb). Indeed, Ansible is executed over SSH.

Has someone succeeded in installing ansible on windows host to use with Ansible ?

Thanks,



Johannes Madel

unread,
Jul 18, 2013, 6:06:27 AM7/18/13
to vagra...@googlegroups.com
Hey,

according to http://www.ansibleworks.com/docs/playbooks2.html it would be possible to start ansible-playbook with the option --connection=local .

I guess a patch for that bug would be very easy.

Best regards,
Johannes

btekab

unread,
Sep 20, 2013, 5:30:03 PM9/20/13
to vagra...@googlegroups.com
t OS(which will make it a bit different than your production environment but should be ok for testing) then this can be done by using the shell provision module, here is what I did:

update 'Vagrantfile' to use the shell provision module to run a bootstrap script
   config.vm.provision :shell, :path => "bootstrap.sh"

 then create "bootstrap.sh" that that installs ansible and run the playbook locally:

#!/usr/bin/env bash
#
# Bootstrap the vagrant VM by installing Ansible and
# letting ansible do the provisioning in local connection mode
#
sudo apt-get update
sudo apt-get install -y python-software-properties
sudo add-apt-repository -y ppa:rquillo/ansible
sudo apt-get update
sudo apt-get install -y ansible
cp /vagrant/hosts /home/vagrant/
chmod 666 /home/vagrant/hosts
sudo ansible-playbook /vagrant/site.yml -i /home/vagrant/hosts --connection=local

now doing "vagrant up" will enable you to have the machine setup similar to all the other machines that u use in stage and production. Hope that helps.
Reply all
Reply to author
Forward
0 new messages