Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.require_version '>= 1.5.1'
Vagrant.configure('2') do |config|
config.vm.define 'dev' do |dev|
dev.vm.box = 'roots/bedrock'
dev.vm.network :private_network, ip: '192.168.50.5'
dev.vm.hostname = 'example.dev'
dev.vm.synced_folder '.', '/srv/www/example.dev/current', owner: 'vagrant', group: 'www-data', mount_options: ['dmode=776', 'fmode=775']
dev.vm.provision :ansible do |ansible|
ansible.playbook = '../bedrock-ansible/site.yml'
ansible.groups = {
'wordpress-server' => ['dev']
}
ansible.extra_vars = {
ansible_ssh_user: 'vagrant',
user: 'vagrant'
}
ansible.sudo = true
end
end
config.vm.define 'prod' do |prod|
prod.vm.box = 'AndrewDryga/digital-ocean'
prod.vm.hostname = 'example.com'
prod.ssh.private_key_path = '~/.ssh/id_rsa'
prod.vm.synced_folder '.', '/vagrant', disabled: true
prod.vm.provider :digital_ocean do |provider, override|
provider.client_id = ENV['DIGITAL_OCEAN_CLIENT_ID']
provider.api_key = ENV['DIGITAL_OCEAN_API_KEY']
provider.image = 'Ubuntu 14.04 x64'
end
prod.vm.provision :ansible do |ansible|
ansible.playbook = '../bedrock-ansible/site.yml'
ansible.groups = {
'wordpress-server' => ['prod']
}
ansible.extra_vars = {
wordpress_sites: [
{
site_name: prod.vm.hostname,
site_hosts: [prod.vm.hostname],
user: 'deploy',
group: 'www-data',
site_install: false,
multisite: {
enabled: false
},
env: {
wp_home: "http://#{prod.vm.hostname}",
wp_siteurl: "http://#{prod.vm.hostname}/wp",
wp_env: 'production',
db_name: 'example_com',
db_user: 'example_com',
db_password: 'example_com'
}
}
]
}
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment