| {% set java_version = pillar.java.environment.get('version', '7') %} |
| |
| {% if java_version == '7' %} |
| {% set java_release = '76' %} |
| {% set java_build = '13' %} |
| {% elif java_version == '8' %} |
| {% set java_release = '60' %} |
| {% set java_build = '27' %} |
| {% endif %} |
| |
| {% set environment = salt['grains.filter_by']({ |
| 'Debian': { |
| 'version': java_version, |
| 'release': java_release, |
| 'home_dir': '/usr/lib/java', |
| 'build': java_build, |
| 'pkgs': ['openjdk-' + java_version + '-jre'], |
| 'dev_pkgs': ['openjdk-' + java_version + '-jdk'], |
| }, |
| 'RedHat': { |
| 'version': java_version, |
| 'release': java_release, |
| 'home_dir': '/usr/lib/java', |
| 'build': java_build, |
| 'pkgs': ['java-1.' + java_version + '.0-openjdk'], |
| 'dev_pkgs': ['java-1.' + java_version + '.0-openjdk'], |
| }, |
| }, merge=salt['pillar.get']('java:environment')) %} |
| |
| {%- set java_home = environment.home_dir %} |
| {%- set version_name = 'jdk1.'+environment.version+'.0_'+environment.release %} |
| {%- set file_name = 'jdk-'+environment.version+'u'+environment.release %} |
| {%- set prefix = '/usr/share/java' %} |
| {%- set source_url = 'http://download.oracle.com/otn-pub/java/jdk/'+environment.version+'u'+environment.release+'-b'+environment.build+'/'+file_name+'-linux-x64.tar.gz' %} |
| {%- set dl_opts = '-b oraclelicense=accept-securebackup-cookie -L' %} |
| {%- set java_real_home = prefix + '/' + version_name %} |
| |
| {%- do environment.update( { 'version_name' : version_name, |
| 'source_url' : source_url, |
| 'dl_opts' : dl_opts, |
| 'java_home' : java_home, |
| 'prefix' : prefix, |
| 'java_real_home' : java_real_home |
| }) %} |