How do I configure SSH keys in a Vagrant multi-machine setup?
There is no general method and it might depend on how boxcutter/ol67 was packed.


The easiest method would be to define the password in the Ansible inventory file:

[oracle-vm:vars]
ansible_ssh_user=vagrant
ansible_ssh_pass=vagrant

The second method would be to leave the insecure private key configured on the oracle-vm machine and inject the private key to the ansible VM:

config.vm.provision "shell" do |s|
  ssh_insecure_key = File.readlines("#{Dir.home}/.vagrant.d/insecure_private_key").first.strip
  s.inline = &lt;&lt;-SHELL
    echo #{ssh_insecure_key} &gt;&gt; /home/vagrant/.ssh/id_rsa
    chown vagrant /home/vagrant/.ssh/id_rsa
    chmod 400 /home/vagrant/.ssh/id_rsa
  SHELL
end

Generate the key pair beforehand on the host machine, inject private key to Ansible VM, public key to Oracle's authorized_keys.
Generate the key pair on Ansible VM, copy the public key to Oracle VM using shell provisioner and inject vagrant as password for ssh-copy-id.


And the list does not end here, it depends on required security.