Hi all, 

I want to use Ansible during the creation of Vagrant Box or Vagrant UP. So 
i have the following configuration about it

config.vm.provision "ansible_local" do |ansible|
>   ansible.extra_vars = { HOSTS: "vagrantbox" }
>   ansible.playbook = "/vagrant/httpd.yaml"    
> end

And in the httpd.yaml file i have this

> ---
> - hosts: localhost
>   vars:
>     http_port: 80
>   remote_user: root
>   tasks:
>   - name: ensure apache is at the latest version
>     yum: name=httpd state=latest
>   - name: ensure apache is running (and enable it at boot)
>     service: name=httpd state=started enabled=yes

 
So when i run the Vagrant up from the directory where i have Vagrant file 
and httpd.yaml file i got this error from Ansible

>     default: Running ansible-playbook...
> PLAY [localhost] 
> ***************************************************************
> skipping: no hosts matched
> PLAY RECAP 
> *********************************************************************


Now the interesting part is that when i do vagrant ssh and try to execute 
the same playbook, it works. It does not give me a problem. 
Yes this is ansible executing the playbook locally for testing.
 Also i want to use ansible-pull but still have the same problem.  

Its not the problem installation of the httpd i know i can do it with 
vagrant, i want to do something with Ansible and i start this simple test. 

Can someone tell me how can i force ansible to work with localhost. 

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vagrant-up/44fac18b-4c28-407b-9b7e-c1a82fdf825a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to