-
Notifications
You must be signed in to change notification settings - Fork 19
Add Support For Apt Provider #34
Description
Thanks for this module.
I find I usually have this module fail due to Oracle website administration issues. I would rather use this module with Apt as the provider and ppa:webupd8team/java. What I have had to do lately is stop using aco-oracl_java on Ubuntu for some versions of Java.
class managelaptops::install_java
(
$wget_temp = $managelaptops::wget_temp,
$java_install_path = $managelaptops::java_install_path
){Exec['apt-update'] -> Package <| |>
$javacmds = join([
'add-apt-repository ppa:webupd8team/java -y;',
'echo "oracle-java8-installer shared/accepted-oracle-license-v1-1 select true" | debconf-set-selections;',
'echo "oracle-java8-installer shared/accepted-oracle-license-v1-1 seen true" | debconf-set-selections;',
])$jcecmd = join([
"cp -f ${wget_temp}/UnlimitedJCEPolicyJDK8/*jar ",
"${java_install_path}/jre/lib/security",
])exec { 'add apt java ppa':
command => $javacmds,
}managelaptops::apt_cleanup{ 'java pre clean':
subject => $title,
require => Exec['add apt java ppa'],
notify => Package['oracle-java8-installer'],
}package { 'oracle-java8-installer':
ensure => installed,
}package { 'oracle-java8-set-default':
ensure => installed,
require => Package['oracle-java8-installer'],
}archive { 'jce_policy-8':
ensure => present,
extract => true,
source => "puppet:///modules/${module_name}/jce_policy-8.zip",
temp_dir => $wget_temp,
path => "${wget_temp}/jce_policy-8.zip",
extract_path => $wget_temp,
cleanup => true,
require => [Package['oracle-java8-installer'],Package['oracle-java8-set-default']],
}the archive is nested and we need the files from a subdirectory
exec { 'copy_jce':
command => $jcecmd,
path => '/usr/bin:/usr/sbin:/bin:/usr/local/bin',
require => [Archive['jce_policy-8']],
}exec { 'clean_jce':
command => "sudo rm -fr ${wget_temp}/jce_policy-8/*",
path => '/usr/bin:/usr/sbin:/bin:/usr/local/bin',
require => [Exec['copy_jce']],
}
}