Reputation: 699
I'm following a few tutorials to learn vagrant and ansible. I get to a point in a tutorial where I have an inventory file of boxes that it will supposedly provision for me:
[loadbalancer]
lb01
[webserver]
app01
app02
[database]
db01
[control]
control ansible_connection=local
Please correct me where I'm wrong, but I think I should have setup the authorized_keys file for each of these machines manually by using "Vagrant up", followed by "vagrant ssh lb01" and placing my public key manually in authorized_keys. Or is there a quicker way to do this part? I certainly hope so.
Thanks! Mike
Upvotes: 0
Views: 100
Reputation: 6547
If you are using Vagrant, you can use the ansible
provisioner.
config.vm.provision "ansible" do |ansible|
ansible.playbook = "playbook.yml"
end
Vagrant takes care of setting up the inventory file and the related SSH private keys for you.
If you do want to see what inventory file has been generated, you can find that at
.vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory
Upvotes: 1