I am using ansible to configure and deploy my app on several machines. The only problem I have now is that I am not sure how to properly initialize/automate the very first connection to this machines?
I am getting completely empty machine, so I have to put on this machine at least my public key into authorized_keys, git into known_hosts, as well as private_key for git user(I am using bitbucket). Currently I run small ansible task for every new machine to do all this things.
But I suppose there is more optimal way to do things?
Probably the only solution I see now is to setup single machine and then 'clone' it(I am using digital ocean). But this won't work for env where I am unable to clone images.