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.

Reply via email to