summaryrefslogtreecommitdiffstats
path: root/installer/vagrant
diff options
context:
space:
mode:
authorramon <ramongomez@us.es>2017-04-19 08:51:31 +0000
committerramon <ramongomez@us.es>2017-04-19 08:51:31 +0000
commit1a2fa9eee2f29f9cbe99ec956a8da5f60827f11e (patch)
tree154e09ad3a08ada36fa7589f878965cb898fb28c /installer/vagrant
parent476d112834bb02c91a8dce4e5fb39fec5ad2dc98 (diff)
#739: Mejorar compatibilidad con Windows en ficheros Vagrant.
git-svn-id: https://opengnsys.es/svn/branches/version1.1@5268 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'installer/vagrant')
-rw-r--r--installer/vagrant/Vagrantfile-devel-vbox14
-rw-r--r--installer/vagrant/Vagrantfile-trunk-vbox14
2 files changed, 18 insertions, 10 deletions
diff --git a/installer/vagrant/Vagrantfile-devel-vbox b/installer/vagrant/Vagrantfile-devel-vbox
index ec6ab674..9cc70c56 100644
--- a/installer/vagrant/Vagrantfile-devel-vbox
+++ b/installer/vagrant/Vagrantfile-devel-vbox
@@ -107,10 +107,14 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
vb.name = "ogAdministrator"
vb.memory = SERVERMEM
vb.cpus = 1
- # Get VM disk path
- line = `VBoxManage list systemproperties`.match("Default machine folder.*")[0]
- vb_machine_folder = line.split(':')[1].strip()
- second_disk = File.join(vb_machine_folder, vb.name, REPODISK)
+ # 2nd virtual disk path (current dir on Windows, VM dir on other OSes)
+ if Vagrant::Util::Platform.windows? then
+ second_disk = File.join(".", REPODISK)
+ else
+ line = `VBoxManage list systemproperties`.match("Default machine folder.*")[0]
+ vb_machine_folder = line.split(':')[1].strip()
+ second_disk = File.join(vb_machine_folder, vb.name, REPODISK)
+ end
# Create repo virtual disk, if needed.
unless File.exist?(second_disk)
vb.customize ['createhd', '--filename', second_disk, '--size', REPOSIZE * 1024]
@@ -122,7 +126,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
og.vm.box = "bento/ubuntu-16.04"
og.vm.hostname = "ogAdministrator"
# Network configuration: forward web port and attach new interface to VMs private network.
- og.vm.network "forwarded_port", guest: 443, host: 8443
+ og.vm.network "forwarded_port", guest: 443, host: LOCALWEBPORT, host_ip: "127.0.0.1"
og.vm.network "private_network", ip: "#{NETPREFIX}10", virtualbox__intnet: true
# Comment out to disable synced folder.
#og.vm.synced_folder ".", "/vagrant", disabled: true
diff --git a/installer/vagrant/Vagrantfile-trunk-vbox b/installer/vagrant/Vagrantfile-trunk-vbox
index e4ce99f3..646c3a62 100644
--- a/installer/vagrant/Vagrantfile-trunk-vbox
+++ b/installer/vagrant/Vagrantfile-trunk-vbox
@@ -78,10 +78,14 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
vb.name = "ogAdministrator"
vb.memory = SERVERMEM
vb.cpus = 1
- # Get VM disk path
- line = `VBoxManage list systemproperties`.match("Default machine folder.*")[0]
- vb_machine_folder = line.split(':')[1].strip()
- second_disk = File.join(vb_machine_folder, vb.name, REPODISK)
+ # 2nd virtual disk path (current dir on Windows, VM dir on other OSes)
+ if Vagrant::Util::Platform.windows? then
+ second_disk = File.join(".", REPODISK)
+ else
+ line = `VBoxManage list systemproperties`.match("Default machine folder.*")[0]
+ vb_machine_folder = line.split(':')[1].strip()
+ second_disk = File.join(vb_machine_folder, vb.name, REPODISK)
+ end
# Create repo virtual disk, if needed.
unless File.exist?(second_disk)
vb.customize ['createhd', '--filename', second_disk, '--size', REPOSIZE * 1024]
@@ -93,7 +97,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
og.vm.box = "ubuntu/trusty64"
og.vm.hostname = "ogAdministrator"
# Network configuration: forward web port and attach new interface to VMs private network.
- og.vm.network "forwarded_port", guest: 443, host: 8443
+ og.vm.network "forwarded_port", guest: 443, host: LOCALWEBPORT, host_ip: "127.0.0.1"
og.vm.network "private_network", ip: "#{NETPREFIX}10", virtualbox__intnet: true
# Comment out to disable synced folder.
#og.vm.synced_folder ".", "/vagrant", disabled: true