Skip to content
This repository has been archived by the owner on Jun 21, 2018. It is now read-only.

Add Support For Apt Provider #34

Open
eric-aldinger opened this issue Aug 8, 2017 · 3 comments
Open

Add Support For Apt Provider #34

eric-aldinger opened this issue Aug 8, 2017 · 3 comments

Comments

@eric-aldinger
Copy link

eric-aldinger commented Aug 8, 2017

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']],
}
}

@eric-aldinger
Copy link
Author

Oh, and support for a JCE resource would be nice as well. 256 bit AES encryption is a wonderful part of Java. :)

@antoineco
Copy link
Owner

antoineco commented Sep 25, 2017

@eric-aldinger I'm not familiar with JCE but I can give it a try. However Oracle locked the Java archives completely for non-authenticated users which made my module completely useless now (edit: fixed in 2.9). Are you currently using it?

Would the PPA you referenced allow me to select which Java version I want to install?

@eric-aldinger
Copy link
Author

LOL! I made the assumption that the thing I use is known to all. Sorry.

JCE is the Java Cryptography Extension (JCE). This comes ina limited strength and "Unlimited Strength Jurisdiction Policy." If a person lives in approved country (basically not Iran or China), they can download the harder to crack encryption tooling (128 or 256 bit encryption). This is always a pain in the butt to automate without using an Exec resource.

Oracle has installs for each version of Java, as does the common PPA
http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html

Here is a sample test
https://gist.github.com/evaryont/6786915

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants