2015-05-28 11:32:57 +02:00
|
|
|
---
|
2015-09-03 02:36:22 +02:00
|
|
|
- name: setup the Oracle JDK repository on ubuntu
|
2016-03-08 10:58:57 +01:00
|
|
|
apt_repository: repo='ppa:webupd8team/java' state=present update_cache=yes
|
2015-09-03 02:36:22 +02:00
|
|
|
when: is_ubuntu
|
2016-03-08 10:58:57 +01:00
|
|
|
tags: [ 'oracle_jdk', 'jdk' ]
|
2015-09-03 02:36:22 +02:00
|
|
|
|
|
|
|
- name: setup the Oracle JDK repository on debian
|
2016-03-08 10:58:57 +01:00
|
|
|
apt_repository: repo='deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main' state=present update_cache=yes
|
2015-09-03 02:36:22 +02:00
|
|
|
when: is_debian
|
2016-03-08 10:58:57 +01:00
|
|
|
tags: [ 'oracle_jdk', 'jdk' ]
|
2015-05-28 11:32:57 +02:00
|
|
|
|
|
|
|
- name: Accept the Oracle Java license
|
|
|
|
debconf: name='oracle-java{{ item }}-installer' question='shared/accepted-oracle-license-v1-1' value='true' vtype='select'
|
2016-03-08 10:58:57 +01:00
|
|
|
with_items: '{{ jdk_version }}'
|
|
|
|
tags: [ 'oracle_jdk', 'jdk' ]
|
2015-05-28 11:32:57 +02:00
|
|
|
|
|
|
|
- name: Install the latest version of Oracle JDK
|
2015-07-22 18:24:50 +02:00
|
|
|
apt: pkg={{ item }} state={{ jdk_pkg_state }} force=yes
|
|
|
|
when: not jdk_use_tarfile
|
2016-03-08 10:58:57 +01:00
|
|
|
with_items: '{{ oracle_jdk_packages }}'
|
|
|
|
tags: [ 'oracle_jdk', 'jdk' ]
|
2015-07-22 18:24:50 +02:00
|
|
|
|
|
|
|
- name: Install the extended security JCE Oracle JDK package
|
|
|
|
apt: pkg=oracle-java{{ item }}-unlimited-jce-policy state={{ jdk_pkg_state }} force=yes
|
2016-03-08 10:58:57 +01:00
|
|
|
with_items: '{{ jdk_version }}'
|
2015-07-22 18:24:50 +02:00
|
|
|
when:
|
|
|
|
- not jdk_use_tarfile
|
|
|
|
- jdk_install_strong_encryption_policy
|
2016-03-08 10:58:57 +01:00
|
|
|
tags: [ 'oracle_jdk', 'jdk' ]
|
2015-05-28 11:32:57 +02:00
|
|
|
|
|
|
|
- name: Set the JDK default via update-alternatives
|
|
|
|
apt: pkg=oracle-java{{ item }}-set-default state={{ jdk_pkg_state }} force=yes
|
2016-03-08 10:58:57 +01:00
|
|
|
with_items: '{{ jdk_default }}'
|
2015-07-22 18:24:50 +02:00
|
|
|
when:
|
|
|
|
- not jdk_use_tarfile
|
|
|
|
- jdk_default is defined
|
|
|
|
notify: Set the default Oracle JDK
|
2016-03-08 10:58:57 +01:00
|
|
|
tags: [ 'oracle_jdk', 'jdk' ]
|
2015-05-28 11:32:57 +02:00
|
|
|
|
|
|
|
- name: Install a custom version of Oracle JDK from a tar file
|
|
|
|
unarchive: src={{ jdk_tarfile }} dest={{ jdk_java_home_prefix }}
|
2016-03-08 10:58:57 +01:00
|
|
|
when: '{{ jdk_use_tarfile }}'
|
|
|
|
tags: [ 'oracle_jdk', 'jdk' ]
|
2015-05-28 11:32:57 +02:00
|
|
|
|
|
|
|
- name: Set fact jdk_installed
|
|
|
|
set_fact: jdk_installed=True
|
2016-03-08 10:58:57 +01:00
|
|
|
tags: [ 'oracle_jdk', 'jdk' ]
|
2015-07-22 18:24:50 +02:00
|
|
|
|