Hi Jamie,
What i want to do is, to have is when the VagrantBox is up or bring up, from the inside of the box, i want Ansibe to make pull or execute the playbook.yml file on the VM (VagrantBox/Guest). I'm using Vagrant to build the VM, and i want Ansible to play role as Pull or to execute locally the playbook. I'll take the ssh.insert_key parameter, but i'm having problem to execute this playbook.yml file locally which is working if i execute after the VM is up and running but not when i build the VM.
I think the problem is that when you build the Vagrant Box, the Ansible take the default host file and search for the localhost information, instead of the playbook.yml or something. Its executing with parameters or something similar.
I try to use host all but i got this error:
default: Running ansible-playbook...
PLAY [all] *********************************************************************
TASK [Gathering Facts] *********************************************************
ok: [default]
TASK [ensure apache is at the latest version] **********************************
fatal: [default]: FAILED! => {"changed": true, "failed": true, "msg": "You need to be root to perform this command.\n", "rc": 1, "results": ["Loaded plugins: fastestmirror\n"]}
to retry, use: --limit @/vagrant/httpd.retry
PLAY RECAP *********************************************************************
default : ok=1 changed=0 unreachable=0 failed=1
Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.
Also the main part here is to use Ansible-Pull which pull the yaml file from Git Repo and then execute locally. But if i can work around with this ill work around with pull to.