Fix out of memory errors and problems with older node versions that stopped vagrant...
authorOla Bini <ola@olabini.se>
Wed, 7 Dec 2016 20:36:33 +0000 (18:36 -0200)
committerOla Bini <ola@olabini.se>
Wed, 7 Dec 2016 20:36:51 +0000 (18:36 -0200)
Vagrantfile
install-pixelated.sh
provisioning/modules/pixelated/manifests/apt.pp

index ad247dc..5d8a66d 100644 (file)
@@ -27,12 +27,12 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
   end
 
   config.vm.provider "libvirt" do |v, override|
-    v.memory = 1024
+    v.memory = 2048
     override.vm.network :forwarded_port, guest: 3333, guest_ip: '127.0.0.1', host: 3333
   end
 
   config.vm.provider "virtualbox" do |v, override|
-    v.memory = 1024
+    v.memory = 2048
     override.vm.network :forwarded_port, guest: 3333, host: 3333 # do NOT add host_ip in this line. It is not necessary
     override.vm.network :forwarded_port, guest: 8089, host: 8089
   end
index 4c6142a..e3f4aaf 100755 (executable)
@@ -57,6 +57,19 @@ function check_installed() {
         set -e
 }
 
+
+# The below is necessary to allow node to use enough memory
+# so that installing phantomjs won't fail
+mkdir -p /home/vagrant/bin
+cat > /home/vagrant/bin/node <<EOF
+#!/usr/bin/env bash
+
+/usr/bin/node --max_old_space_size=2000 "\$@"
+EOF
+chmod +x /home/vagrant/bin/node
+export PATH=/home/vagrant/bin:$PATH
+
+
 function install_node_modules_at_custom_location() {
   local LOCATION="$1"
   local WEBUI_DIR=$(pwd)
index bd44b86..cf9cda6 100644 (file)
@@ -60,8 +60,8 @@ class pixelated::apt {
   # nodejs latest repo
   file { '/etc/apt/sources.list.d/noderesource.list':
     content =>
-      'deb https://deb.nodesource.com/node_6.x jessie main
-      deb-src https://deb.nodesource.com/node_6.x jessie main',
+      'deb https://deb.nodesource.com/node_7.x jessie main
+      deb-src https://deb.nodesource.com/node_7.x jessie main',
     owner   => 'root'
   }
   exec{'add_nodesource_key':