Skip to content

Instantly share code, notes, and snippets.

@arusso
Created March 27, 2013 19:00
Show Gist options
  • Save arusso/5257049 to your computer and use it in GitHub Desktop.
Save arusso/5257049 to your computer and use it in GitHub Desktop.
Update hosts to use java-1.7.0-oracle via Puppet
# Ensure Java 1.7 is installed
package { 'java-1.7.0-oracle': ensure => installed }
# update alternatives only if it's not set correctly already
exec { 'alternatives --set java \
/usr/lib/jvm/jre-1.7.0-oracle.x86_64/bin/java':
unless => "test $(readlink /etc/alternatives/java) == \
'/usr/lib/jvm/jre-1.7.0-oracle.x86_64/bin/java'",
require => Package['java-1.7.0-oracle'],
path => ['/bin','/usr/sbin','/usr/bin'],
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment