Commit 57d13a0e637f3cfa2c09ec9d001e4476aef40cbe
1 parent
0f55b412
Exists in
dev_env_minimal
Changing provider from virtualbox to lxc
Showing
2 changed files
with
19 additions
and
14 deletions
Show diff stats
Rakefile
@@ -22,7 +22,7 @@ chake_rsync_options += ' --exclude src' | @@ -22,7 +22,7 @@ chake_rsync_options += ' --exclude src' | ||
22 | ENV['CHAKE_RSYNC_OPTIONS'] = chake_rsync_options | 22 | ENV['CHAKE_RSYNC_OPTIONS'] = chake_rsync_options |
23 | 23 | ||
24 | if $SPB_ENV == 'lxc' | 24 | if $SPB_ENV == 'lxc' |
25 | - system("mkdir -p config/lxc; sudo lxc-ls -f -F name,ipv4 | sed -e '/^softwarepublico/ !d; s/softwarepublico_//; s/_[0-9_]*/:/ ' > #{ips_file}.new") | 25 | + system("mkdir -p config/lxc; sudo lxc-ls -f -F name,ipv4 | sed -e '/^[deirs]/ !d ; s/\s/:/' > #{ips_file}.new") |
26 | begin | 26 | begin |
27 | ips = YAML.load_file("#{ips_file}.new") | 27 | ips = YAML.load_file("#{ips_file}.new") |
28 | raise ArgumentError unless ips.is_a?(Hash) | 28 | raise ArgumentError unless ips.is_a?(Hash) |
Vagrantfile
@@ -9,7 +9,10 @@ load './local.rake' if File.exists?('local.rake') | @@ -9,7 +9,10 @@ load './local.rake' if File.exists?('local.rake') | ||
9 | VAGRANTFILE_API_VERSION = "2" | 9 | VAGRANTFILE_API_VERSION = "2" |
10 | 10 | ||
11 | Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | 11 | Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| |
12 | - config.vm.box = ENV.fetch("VAGRANT_BOX", 'seocam/centos-7.0') | 12 | + |
13 | + # Place the main box | ||
14 | + config.vm.box = ENV.fetch("VAGRANT_BOX", 'frensjan/centos-7-64-lxc') | ||
15 | + | ||
13 | proxy = ENV['http_proxy'] || ENV['HTTP_PROXY'] | 16 | proxy = ENV['http_proxy'] || ENV['HTTP_PROXY'] |
14 | if proxy | 17 | if proxy |
15 | config.vm.provision 'shell', path: 'utils/proxy.sh', args: [proxy] | 18 | config.vm.provision 'shell', path: 'utils/proxy.sh', args: [proxy] |
@@ -24,30 +27,32 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | @@ -24,30 +27,32 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | ||
24 | end | 27 | end |
25 | 28 | ||
26 | config.vm.define 'database' do |database| | 29 | config.vm.define 'database' do |database| |
27 | - database.vm.provider "virtualbox" do |vm, override| | ||
28 | - override.vm.network 'private_network', ip: ips['database'] if ips | 30 | + database.vm.provider :lxc do |vm| |
31 | + vm.container_name = :machine | ||
29 | end | 32 | end |
30 | end | 33 | end |
34 | + | ||
31 | config.vm.define 'integration' do |integration| | 35 | config.vm.define 'integration' do |integration| |
32 | - integration.vm.provider "virtualbox" do |vm, override| | ||
33 | - override.vm.network 'private_network', ip: ips['integration'] if ips | ||
34 | - vm.memory = 1024 | ||
35 | - vm.cpus = 2 | 36 | + integration.vm.provider :lxc do |vm| |
37 | + vm.container_name = :machine | ||
36 | end | 38 | end |
37 | end | 39 | end |
40 | + | ||
38 | config.vm.define 'email' do |email| | 41 | config.vm.define 'email' do |email| |
39 | - email.vm.provider "virtualbox" do |vm, override| | ||
40 | - override.vm.network 'private_network', ip: ips['email'] if ips | 42 | + email.vm.provider :lxc do |vm| |
43 | + vm.container_name = :machine | ||
41 | end | 44 | end |
42 | end | 45 | end |
46 | + | ||
43 | config.vm.define 'social' do |social| | 47 | config.vm.define 'social' do |social| |
44 | - social.vm.provider "virtualbox" do |vm, override| | ||
45 | - override.vm.network 'private_network', ip: ips['social'] if ips | 48 | + social.vm.provider :lxc do |vm| |
49 | + vm.container_name = :machine | ||
46 | end | 50 | end |
47 | end | 51 | end |
52 | + | ||
48 | config.vm.define 'reverseproxy' do |reverseproxy| | 53 | config.vm.define 'reverseproxy' do |reverseproxy| |
49 | - reverseproxy.vm.provider "virtualbox" do |vm, override| | ||
50 | - override.vm.network 'private_network', ip: ips['reverseproxy'] if ips | 54 | + reverseproxy.vm.provider :lxc do |vm| |
55 | + vm.container_name = :machine | ||
51 | end | 56 | end |
52 | if File.exist?("tmp/preconfig.#{env}.stamp") | 57 | if File.exist?("tmp/preconfig.#{env}.stamp") |
53 | reverseproxy.ssh.port = File.read("tmp/preconfig.#{env}.stamp").strip.to_i | 58 | reverseproxy.ssh.port = File.read("tmp/preconfig.#{env}.stamp").strip.to_i |