I downloaded the bedrock-ansible and bedrock repos into the following locations:
/Users/btamm/Sites/brandontamm/bedrock-ansible
/Users/btamm/Sites/brandontamm/example.dev
I followed the instructions from bedrock-ansible, set the vagrant file and group_vars and try to run ‘vagrant up.’ Everything works as supposed to, the machine boots, mounts shared folders, and then ttys to run provisioner: ansible and I receive the following error message:
The executable ‘ansible-playbook’ Vagrant is trying to run was not
found in the PATH variable. This is an error. Please verify
this software is installed and on the path.
I have tried every variation of adjusting the path:
ansible.playbook = './bedrock-ansible/site.yml’
ansible.playbook = './site.yml’
ansible.playbook = '…/bedrock-ansible/site.yml’
ansible.playbook = ‘…/site.yml’
I am assuming the error has something to do with my path. I made no adjustments to site.yml and have not moved it from the original location. Am I missing something?
That error message just means that the executable ansible-playbook couldn’t be found. Did you install Ansible first? If running ansible-playbook doesn’t work in your terminal, then it won’t work through Vagrant either.
Not too much yet. Docker is awesome but probably not needed in most basic server setups (which WP sites often are)
Well we’re using both of them? Didn’t choose one over the other. Vagrant is meant for development environments so that’s what we’re using it for. And Ansible for server provisioning.
The VM that is created is 512 mb. My macbook runs with 8gb ram. - is there a variable I can change to increase the amount of dedicated ram to the virtual machine?
I’m a little bit confused here–does this mean I can run multiple sites from a single Bedrock Ansible project simultaneously, like one would with MAMP and virtual hosts? If that’s the case, I may be missing something.
Setting up my group_vars/all file as instructed above works until Composer runs, which throws this error:
stdout: Composer could not find a composer.json file in /srv/www/example.dev/current
My Vagrantfile is pretty minimally modified:
config.vm.network :private_network, ip: '192.168.50.5'
# config.vm.hostname = 'example.dev' # This is taken care of via /group_vars/all, right?
# adjust paths relative to Vagrantfile
config.vm.synced_folder '../sites', '/srv/www', owner: 'vagrant', group: 'www-data', mount_options: ['dmode=776', 'fmode=775']
My impression was that the synced folder would be your/sites/dir instead of your/sites/dir/specificsite.dev. But it doesn’t look like Vagrant is seeing my development files at all. What am I doing wrong here?
Yeah, config.vm.hostname isn’t really needed but should probably be set to something. Could just be sites.dev or something for identification purposes.
Right now you need to explicitly set up every individual site as a synced folder.
Ohh. Duh. Well there’s my problem. I thought I tried adding multiple synced folders and it only found one of them, but it probably failed on the first one because my directory structure was bad.
I’ll try it as soon as I’m back at the ole desk, though I’m strongly considering keeping one VM per project.
Is it safe to assume that this Ansible playbook is secure for provisioning a production server? It sounds like you use it yourself for this, but just wondering what your thoughts are.