Seamless provisioning, install and configuration automation in Ansible

Hi,

I’m automating a QA environment which involves provisioning VM’s on the cloud and installation of Kubernetes cluster. I’m able to install and configure Kubernetes on the VM’s after provisioning thanks to the Kubernetes Contrib.

I would like to know how I can provision a VM, copy the public keys to the VM created, and proceed with the installation of Kubernetes without manual intervention. Currently I can’t figure out a way in which I can copy the ssh keys to the provisioned VM without the password prompt. Any directions on how to achieve this would be very helpful.

Thanks,

Are you able to modify the VM templates? That would be simplest.
Depending on your virtualiser there is usually a way to run a 'first boot' step
on newly created VMs; that might be another way to get the initial pubkey
(that Ansible will use) installed.

Could you please point to some links on how it can done through Azure?

Thanks,

I've never used Azure but this looks like what you want:

https://azure.microsoft.com/en-us/blog/custom-data-and-cloud-init-on-windows-azure/