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 | 22 | ENV['CHAKE_RSYNC_OPTIONS'] = chake_rsync_options |
| 23 | 23 | |
| 24 | 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 | 26 | begin |
| 27 | 27 | ips = YAML.load_file("#{ips_file}.new") |
| 28 | 28 | raise ArgumentError unless ips.is_a?(Hash) | ... | ... |
Vagrantfile
| ... | ... | @@ -9,7 +9,10 @@ load './local.rake' if File.exists?('local.rake') |
| 9 | 9 | VAGRANTFILE_API_VERSION = "2" |
| 10 | 10 | |
| 11 | 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 | 16 | proxy = ENV['http_proxy'] || ENV['HTTP_PROXY'] |
| 14 | 17 | if proxy |
| 15 | 18 | config.vm.provision 'shell', path: 'utils/proxy.sh', args: [proxy] |
| ... | ... | @@ -24,30 +27,32 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| |
| 24 | 27 | end |
| 25 | 28 | |
| 26 | 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 | 32 | end |
| 30 | 33 | end |
| 34 | + | |
| 31 | 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 | 38 | end |
| 37 | 39 | end |
| 40 | + | |
| 38 | 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 | 44 | end |
| 42 | 45 | end |
| 46 | + | |
| 43 | 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 | 50 | end |
| 47 | 51 | end |
| 52 | + | |
| 48 | 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 | 56 | end |
| 52 | 57 | if File.exist?("tmp/preconfig.#{env}.stamp") |
| 53 | 58 | reverseproxy.ssh.port = File.read("tmp/preconfig.#{env}.stamp").strip.to_i | ... | ... |