Last active
August 29, 2015 14:01
-
-
Save swalkinshaw/fcb08adfaf86a4be0806 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- 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