forked from ISTI-ansible-roles/ansible-roles
library/roles/oracle-jdk: Install the extended security policy as a package.
This commit is contained in:
parent
bb1d5ceebb
commit
b3a24547ce
|
@ -6,8 +6,12 @@ jdk_version:
|
||||||
- '{{ jdk_default }}'
|
- '{{ jdk_default }}'
|
||||||
jdk_java_home: '/usr/lib/jvm/java-{{ jdk_default }}-oracle'
|
jdk_java_home: '/usr/lib/jvm/java-{{ jdk_default }}-oracle'
|
||||||
jdk_pkg_state: installed
|
jdk_pkg_state: installed
|
||||||
jdk_install_strong_encryption_policy: False
|
oracle_jdk_packages:
|
||||||
|
- 'oracle-java{{ jdk_default }}-installer'
|
||||||
|
- 'oracle-java{{ jdk_default }}-set-default'
|
||||||
|
jdk_install_strong_encryption_policy: True
|
||||||
|
|
||||||
# If we want a different oracle jdk set the following variables in the local playbook:
|
# If we want a different oracle jdk set the following variables in the local playbook:
|
||||||
|
jdk_use_tarfile: False
|
||||||
# jdk_java_home: /usr/lib/jvm/java-7-0-25
|
# jdk_java_home: /usr/lib/jvm/java-7-0-25
|
||||||
# jdk_use_tarfile: True
|
|
||||||
# jdk_tarfile: oracle-jdk-7.0.25.tar.gz
|
# jdk_tarfile: oracle-jdk-7.0.25.tar.gz
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -15,33 +15,35 @@
|
||||||
tags: jdk
|
tags: jdk
|
||||||
|
|
||||||
- name: Install the latest version of Oracle JDK
|
- name: Install the latest version of Oracle JDK
|
||||||
apt: pkg=oracle-java{{ item }}-installer state={{ jdk_pkg_state }} force=yes
|
apt: pkg={{ item }} state={{ jdk_pkg_state }} force=yes
|
||||||
|
when: not jdk_use_tarfile
|
||||||
|
with_items: oracle_jdk_packages
|
||||||
|
tags: jdk
|
||||||
|
|
||||||
|
- name: Install the extended security JCE Oracle JDK package
|
||||||
|
apt: pkg=oracle-java{{ item }}-unlimited-jce-policy state={{ jdk_pkg_state }} force=yes
|
||||||
when: jdk_use_tarfile is not defined or not jdk_use_tarfile
|
when: jdk_use_tarfile is not defined or not jdk_use_tarfile
|
||||||
with_items: jdk_version
|
with_items: jdk_version
|
||||||
|
when:
|
||||||
|
- not jdk_use_tarfile
|
||||||
|
- jdk_install_strong_encryption_policy
|
||||||
tags: jdk
|
tags: jdk
|
||||||
|
|
||||||
- name: Set the JDK default via update-alternatives
|
- name: Set the JDK default via update-alternatives
|
||||||
apt: pkg=oracle-java{{ item }}-set-default state={{ jdk_pkg_state }} force=yes
|
apt: pkg=oracle-java{{ item }}-set-default state={{ jdk_pkg_state }} force=yes
|
||||||
with_items: jdk_default
|
with_items: jdk_default
|
||||||
when: jdk_use_tarfile is not defined or not jdk_use_tarfile
|
when:
|
||||||
notify:
|
- not jdk_use_tarfile
|
||||||
Set the default Oracle JDK
|
- jdk_default is defined
|
||||||
when: jdk_default is defined
|
notify: Set the default Oracle JDK
|
||||||
tags: jdk
|
tags: jdk
|
||||||
|
|
||||||
- name: Install a custom version of Oracle JDK from a tar file
|
- name: Install a custom version of Oracle JDK from a tar file
|
||||||
unarchive: src={{ jdk_tarfile }} dest={{ jdk_java_home_prefix }}
|
unarchive: src={{ jdk_tarfile }} dest={{ jdk_java_home_prefix }}
|
||||||
when: jdk_use_tarfile is defined and jdk_use_tarfile
|
when: jdk_use_tarfile
|
||||||
tags: jdk
|
tags: jdk
|
||||||
|
|
||||||
- name: Set fact jdk_installed
|
- name: Set fact jdk_installed
|
||||||
set_fact: jdk_installed=True
|
set_fact: jdk_installed=True
|
||||||
tags: [ 'jdk', 'jdk_security' ]
|
tags: jdk
|
||||||
|
|
||||||
- name: Install the strong encryption policy files
|
|
||||||
copy: src=jdk-{{ item.0 }}-{{ item.1 }} dest={{ jdk_java_home }}/jre/lib/security/{{ item.1}} mode=0444 owner=root group=root
|
|
||||||
with_nested:
|
|
||||||
- '{{ jdk_version }}'
|
|
||||||
- [ 'US_export_policy.jar', 'local_policy.jar' ]
|
|
||||||
when: jdk_install_strong_encryption_policy
|
|
||||||
tags: [ 'jdk', 'jdk_security' ]
|
|
||||||
|
|
Loading…
Reference in New Issue