Hello

Can you check these examples?

Since they don't require anything special:

# Enable provisioning with Ansible.
config.vm.provision "ansible" do |ansible|
ansible.playbook = "provisioning/main.yml"
end


https://github.com/geerlingguy/ansible-vagrant-examples/blob/master/docker/Vagrantfile



On Tue, Aug 4, 2015 at 6:17 PM, Joaquin Menchaca <[email protected]> wrote:
> Hello.
>
> I wanted to do host base configuration using hostname, and then dynamically
> populating inventory file with appropriate guest SSH port and private key
> path.
>
> Vagrant Ansible Provisioner doesn't work if you rely on it to auto-generate
> the inventory file, as it uses 127.0.0.1 for hostname.  For example, it'll
> create a file /path/to/vagrant/.vagrant/provisioners/ansible/inventory/:
>
> default ansible_ssh_host=127.0.0.1 ansible_ssh_port=2200
> ansible_ssh_private_key_file=/path/to/vagrantdir/.vagrant/machines/default/virtualbox/private_key
>
> I tried experimenting retrieving values (newbie working with vagrant ruby
> code), testing something like
>
>   puts "config.ssh.private_key_path=#{config.ssh.private_key_path}"
>   puts "config.ssh.guest_port=#{config.ssh.guest_port}"
>
> But his returns objects, and I am not sure what to do.  Any suggestions?
>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/vagrant-up/a7036744-42ff-4f66-b650-54e94a3b63cb%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vagrant-up/CAHqq0ewOSG063WNu4JFbfJ%2BF_xgQXk-01fBWU47FwgaF_vn5cg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to