Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[DS-2014] tweaked Vagrantfile to use the hosts' DNS resolver to speed…

… up discovery of package repositories and make provisioning more dependable (less timeouts), pre-load the icedtea-7-plugin to help make update-java-alternatives more dependable, revamped how Java 7 is installed and set ast the default, to make Tomcat7 find it more reliably
  • Loading branch information...
commit 0c7b117ad3c270e9a4192eaf0bb4fa106313ed53 1 parent a1e8dee
@hardyoyo hardyoyo authored
Showing with 26 additions and 4 deletions.
  1. +3 −0  Vagrantfile
  2. +23 −4 modules/dspace/manifests/init.pp
View
3  Vagrantfile
@@ -200,6 +200,9 @@ Vagrant.configure("2") do |config|
# Use VBoxManage to provide Virtual Machine with extra memory (default is only 300MB)
vb.customize ["modifyvm", :id, "--memory", vb_memory]
+ # Use VBoxManage to have the Virtual Machine use the Host's DNS resolver
+ vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
+
# Use VBoxManage to ensure Virtual Machine only has access to 50% of host CPU
#vb.customize ["modifyvm", :id, "--cpuexecutioncap", "50"]
View
27 modules/dspace/manifests/init.pp
@@ -19,17 +19,36 @@
ensure => installed,
}
+ # Java installation directory
+ $install_dir = "/usr/lib/jvm"
+
+ # OpenJDK directory name (NOTE: $architecture is a "fact")
+ $dir_name = "java-1.${java_version}.0-openjdk-${architecture}"
+
# Install Java, based on set $java_version (passed to Puppet in VagrantFile)
package { "java":
name => "openjdk-${java_version}-jdk", # Install OpenJDK package (as Oracle JDK tends to require a more complex manual download & unzip)
}
- # Set Java defaults to point at our Java package
+ # Install the IcedTea plugin, as its absence seems to cause update-java-alternatives to fail
+ package { "icedtea-7-plugin":
+ name => "icedtea-7-plugin"
+ }
+
+ # Set Java defaults to point at OpenJDK
# NOTE: $architecture is a "fact" automatically set by Puppet's 'facter'.
- exec { "Update alternatives to Java ${jdk_version}":
+ exec { "Update alternatives to OpenJDK Java ${version}":
command => "update-java-alternatives --set java-1.${java_version}.0-openjdk-${architecture}",
- unless => "test \$(readlink /etc/alternatives/java) = '/usr/lib/jvm/java-${java_version}-openjdk-${architecture}/jre/bin/java'",
- require => [Package["java"], Package["maven"]], # Run *after* Maven is installed, since Maven install sometimes changes the java alternative!
+ unless => "test \$(readlink /etc/alternatives/java) = '${install_dir}/${dir_name}/jre/bin/java'",
+ path => "/usr/bin:/usr/sbin:/bin",
+ }
+
+ ->
+ # Create a "default-java" symlink (for easier JAVA_HOME setting). Overwrite if existing.
+ exec { "Symlink OpenJDK to '${install_dir}/default-java'":
+ cwd => $install_dir,
+ command => "ln -sfn ${dir_name} default-java",
+ unless => "test \$(readlink ${install_dir}/default-java) = '${dir_name}'",
path => "/usr/bin:/usr/sbin:/bin",
}
Please sign in to comment.
Something went wrong with that request. Please try again.