Bedrock Vagrant/Ansible released

I’ve done it with this Vagrantfile: https://gist.github.com/swalkinshaw/fcb08adfaf86a4be0806

You need this plugin installed: https://github.com/smdahlen/vagrant-digitalocean and the proper DO env vars set up as seen in the Vagrantfile for api keys etc.

But it requires more configuration that I don’t have right now. The prod box references a new prod.yml playbook instead of the normal site.yml. It’s basically the same but doesn’t run the wordpress-sites role.

So the steps would be something like this:

  1. Run vagrant prod up --no-provision
  2. Create a prod specific prod.yml playbook with the roles you want
  3. Create a new hosts file with a [wordpress-server-prod] group and the DO ip/host
  4. You could move the group_vars/all to be env specific at group_vars/wordpress-server-prod and group_vars/wordpress-server if you only want those vars to apply to each server
  5. Run vagrant prod provision
  6. Update Capistrano configs with the correct prod ip/host
  7. Run cap production deploy

The steps are something like that…

Honestly I don’t think production servers should be managed with Vagrant. Maybe if you want a remote dev server. I’d probably just set up the servers manually (if you only have 1 per site or 1 total) and then run ansible-playbook -i prod.yml hosts manually.