I have a Vagrant and CentOS related question. I'm trying to replicate a CentOS server which uses WHM/cPanel for hosting. Each site on the server is hosted in /home/$user/
. This means with Vagrant I need to have a synced folder which is something like:
config.vm.synced_folder "~/my-local-folder", "/home"
Replicating this environment with Vagrant becomes an issue as the vagrant user (used for accessing the vagrant box) is stored inside the /home
directory. This means that the process of syncing the folders removes the vagrant user (unless the vagrant directory already exists within my-local-folder).
I've found a way of recreating the vagrant user (including its ssh keys) as part of provisioning the server with puppet. I basically add back in the vagrant folder and create the .ssh keys but this feels wrong.
Is there another way I should be approaching this? Hosting the files on the Vagrant box in any other location is not an option as the aim is to replicate the box as closely as possible. It occurs to me that creating the vagrant user outside of the home directory would solve this entirely but i've not been able to find out if this is even possible.