I have a virtual machine set up with Vagrant. The plan is to provision the vm with a shell script. The Script shall do things, connect to my company's ansible server and let the server run a playbook with the hostlist set to the vm. Now the problem is to make the connections. Because everything shall run automatically user input should be rare or not necessary at all.
I tried to do this via ssh. The server's key is already on my vm. The key of the virtual machine has to be put on the server. My Problem here is that one need to have the password for the server to connect to the first time the connection is established.
I don't use ansible-pull or Ansible as a provisioner for Vagrant because everything shall work on Windows as well.
Do you have any suggestions how to do this and what are different approaches, that might work?