-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathVagrantfile.sample
131 lines (118 loc) · 5.33 KB
/
Vagrantfile.sample
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#!/usr/bin/env ruby
#^syntax detection
Vagrant.configure("2") do |config|
config.vm.box = 'precise32'
config.vm.box_url = 'http://files.vagrantup.com/precise32.box'
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# config.vm.network :forwarded_port, guest: 80, host: 8080
# Create a private network, which allows host-only access to the machine
# using a specific IP.
config.vm.network :private_network, ip: "192.168.33.10"
# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
# config.vm.network :public_network
# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
config.vm.synced_folder ".", "/vagrant",
:nfs => (RUBY_PLATFORM =~ /linux/ or RUBY_PLATFORM =~ /darwin/)
# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
# Example for VirtualBox:
config.vm.provider :virtualbox do |vb|
# Don't boot with headless mode
# vb.gui = true
# Use VBoxManage to customize the VM. For example to change memory:
vb.customize ["modifyvm", :id, "--memory", "512"]
end
# View the documentation for the provider you're using for more
# information on available options.
# Enable provisioning with chef solo, specifying a cookbooks path, roles
# path, and data_bags path (all relative to this Vagrantfile), and adding
# some recipes and/or roles.
config.vm.provision :chef_solo do |chef|
# chef debug level, start vagrant like this to debug:
# $ CHEF_LOG_LEVEL=debug vagrant <provision or up>
chef.log_level = ENV['CHEF_LOG_LEVEL'] || "info"
# chef.add_recipe 'apt'
chef.add_recipe 'wpcli'
chef.json = {
'wpcli' => { # everything is optional
'installs' => { # wp installs
'wptest' => { # wp install 1
# 'path' => '/custom/path' # default: /var/www/{installname}
# 'version' => '3.5.something', # wp version, default: latest
# db options: dbname dbuser dbpass dbprefix
# user #1 options: admin_name admin_email admin_password (default admin/admin)
'url' => 'mywptest.dev', # add it to the hosts file on the host machine to visit the site
'title' => 'my theme test',
'themes' => {
'mytheme' => {
'source' => '/vagrant/my-wp-theme', # theme src dir my-wp-theme sitting next to this vagrantfile on the host
'active' => true
}
'sometheme' => { # install sometheme from official repo
# 'version' => '1.2.3' # default: latest
}
'othertheme' => { # install from zip
'zip' => '/vagrant/othertheme.zip' # othertheme.zip sitting next to this vagrantfile on the host,
}
},
'theme' => 'mytheme', # active theme
# 'clean-install' => true, # would erase files and database every time chef run
# set update-core, update-plugins or update-themes to truthy to update wp, plugins or themes every time chef run
# you can also set update flag for single plugins or themes
},
'wptest-network' => { # wp install 2
'url' => 'mywptest-net.dev',
'title' => 'buddypress multisite test',
'network' => { # multisite install
'title' => 'wordpress multisite network',
# 'path' => '/',
# 'subdomain' = true
'sites' => { #additional sites
'site2-on-the-network' => { # slug
# optionally set 'slug','title','site_id','email','private'
# 'plugins' => array of plugin to activate on this site
# 'theme' => theme to activate on this site
},
'site3' => {}
}
},
'plugins' => {
'buddypress' => { # install buddypress from official repo
# 'version' => '1.2.3' # default: latest
'network' => true,
'active' => true
},
'buddypress-plugin' => {
'source' => '/vagrant/my-bp-plugin', # plugin src dir my-bp-plugin sitting next to this vagrantfile on the host
'network' => true,
'active' => true
}
'must-use-plugin' => {
'zip' => '/vagrant/muplugin.zip',
'must-use' => true # installed in must use folder, always active
}
}
}
},
'user' => 'vagrant',
'group' => 'vagrant',
},
'mysql' => {
'server_root_password' => 'iloverandompasswordsbutthiswilldo',
'server_repl_password' => 'iloverandompasswordsbutthiswilldo',
'server_debian_password' => 'iloverandompasswordsbutthiswilldo'
},
'apache' => {
'user' => 'vagrant',
'group' => 'vagrant',
}
}
end
end