@@ -45,9 +45,18 @@ DISCLAIMER: usage of any version of this role implies you have accepted the
4545
4646- ** debug** : flag to make role more verbose.
4747- ** oracle_java_os_supported** : role internal variable to check if a OS family is supported or not.
48+ - ** oracle_java_set_as_default** : flag to indicate if this play should set Java as default (default: ` yes ` ).
49+ - ** oracle_java_use_defaults** : flag to indicate you want to use defaults set in the ` defaults ` directory (default: ` yes ` ).
50+ ** WARNING** . setting this to ` no ` will require the user to pass all of the distribution variables.
51+ See ` * | Java 8 ` examples in the _ Playbooks_ section.
4852
4953### Debian
5054
55+ ** WARNING** to override ** any** of the following variables (even if it's only one),
56+ you'll need to set ` oracle_java_use_defaults: no ` and override ** all** of their values since
57+ OS family defaults will no longer be loaded.
58+ See ` debian | Java 8 ` example in the _ Playbooks_ section.
59+
5160- ** oracle_java_apt_repository** : Personal Package Archive (PPA) from where to install Java.
5261- ** oracle_java_apt_repository_key** : PPA repository key.
5362- ** oracle_java_cache_valid_time** : the amount of time in seconds the apt cache is valid.
@@ -58,6 +67,11 @@ DISCLAIMER: usage of any version of this role implies you have accepted the
5867
5968### Debian/Ubuntu
6069
70+ ** WARNING** to override ** any** of the following variables (even if it's only one),
71+ you'll need to set ` oracle_java_use_defaults: no ` and override ** all** of their values since
72+ OS family defaults will no longer be loaded.
73+ See ` debian | ubuntu | Java 8 ` example in the _ Playbooks_ section.
74+
6175- ** oracle_java_apt_repository** : Personal Package Archive (PPA) from where to install Java.
6276- ** oracle_java_cache_valid_time** : the amount of time in seconds the apt cache is valid.
6377- ** oracle_java_deb_package** : name of debian package.
@@ -67,13 +81,17 @@ DISCLAIMER: usage of any version of this role implies you have accepted the
6781
6882### Redhat-only
6983
84+ ** WARNING** to override ** any** of the following variables (even if it's only one),
85+ you'll need to set ` oracle_java_use_defaults: no ` and override ** all** of their values since
86+ OS family defaults will no longer be loaded.
87+ See ` redhat | centos 7 | Java 8 ` example in the _ Playbooks_ section.
88+
7089- ** oracle_java_dir_source** : directory where to store the RPM files.
7190- ** oracle_java_download_timeout** : download timeout, in seconds.
7291- ** oracle_java_home** : the location of the Java home directory.
7392- ** oracle_java_rpm_filename** : file name used for the download destination.
7493- ** oracle_java_rpm_url** : where to download the rpm from.
7594- ** oracle_java_rpm_validate_certs** : flag to indicate if you want SSL certificate validation.
76- - ** oracle_java_set_as_default** : flag to indicate if this should be set as the default version.
7795- ** oracle_java_version_string** : the Java version string to verify installation against.
7896
7997## Playbooks
@@ -88,68 +106,65 @@ DISCLAIMER: usage of any version of this role implies you have accepted the
88106- hosts : servers
89107 roles :
90108 - role : ansiblebit.oracle-java
91- oracle_java_apt_repository : ' deb http://ppa.launchpad.net/linuxuprising/java/ubuntu bionic main'
92- oracle_java_apt_repository_key : ' EA8CACC073C3DB2A'
93- oracle_java_cache_valid_time : 3600
94- oracle_java_deb_package : ' oracle-java10-installer'
95- oracle_java_debconf_package_default : ' oracle-java10-set-default'
96- oracle_java_home : " /usr/lib/jvm/java-10-oracle"
97- oracle_java_state : latest
109+
110+ # # explicitely passing default parameters
111+ - hosts : servers
112+ roles :
113+ - role : ansiblebit.oracle-java
98114
99115# debian | Java 8
100116- hosts : servers
101117 roles :
102118 - role : ansiblebit.oracle-java
119+ oracle_java_use_defaults : no
103120 oracle_java_apt_repository : ' deb http://ppa.launchpad.net/webupd8team/java/ubuntu bionic main'
104121 oracle_java_apt_repository_key : ' EA8CACC073C3DB2A'
105122 oracle_java_cache_valid_time : 3600
106123 oracle_java_deb_package : ' oracle-java8-installer'
107124 oracle_java_debconf_package_default : ' oracle-java8-set-default'
108125 oracle_java_home : " /usr/lib/jvm/java-8-oracle"
126+ oracle_java_set_as_default : no
109127 oracle_java_state : latest
110128
111129# debian | ubuntu | Java 10
112130- hosts : servers
113131 roles :
114132 - role : ansiblebit.oracle-java
115- oracle_java_apt_repository : " ppa:linuxuprising/java"
116- oracle_java_cache_valid_time : 3600
117- oracle_java_deb_package : ' oracle-java10-installer'
118- oracle_java_debconf_package_default : ' oracle-java10-set-default'
119- oracle_java_home : " /usr/lib/jvm/java-10-oracle"
120- oracle_java_state : latest
121133
122134# debian | ubuntu | Java 8
123135- hosts : servers
124136 roles :
125137 - role : ansiblebit.oracle-java
138+ oracle_java_use_defaults : no
126139 oracle_java_apt_repository : " ppa:webupd8team/java"
127140 oracle_java_cache_valid_time : 3600
128141 oracle_java_deb_package : ' oracle-java10-installer'
129142 oracle_java_debconf_package_default : ' oracle-java10-set-default'
130143 oracle_java_home : " /usr/lib/jvm/java-10-oracle"
144+ oracle_java_set_as_default : no
131145 oracle_java_state : latest
132146
133147# redhat | centos 7 | Java 10
148+ - hosts : servers
149+ roles :
150+ - role : ansiblebit.oracle-java
151+
152+ # redhat | centos 7 | Java 8
134153- hosts : servers
135154 roles :
136155 - role : ansiblebit.oracle-java
137156 oracle_java_dir_source : ' /usr/local/src'
138- oracle_java_download_timeout : 60
157+ oracle_java_download_timeout : 60
158+ oracle_java_rpm_filename : ' jdk-8u181-linux-x64.rpm'
139159 oracle_java_home : ' /usr/java/default'
140- oracle_java_rpm_filename : ' jdk-10.0.2_linux-x64_bin.rpm '
141- oracle_java_rpm_url : ' http://download.oracle.com/otn-pub/java/jdk/10.0.2+13/19aef61b38124481863b1413dce1855f /jdk-10.0.2_linux-x64_bin .rpm'
160+ oracle_java_os_supported : yes
161+ oracle_java_rpm_url : ' http://download.oracle.com/otn-pub/java/jdk/8u181-b13/96a7b8442fe848ef90c96a2fad6ed6d1 /jdk-8u181-linux-x64 .rpm'
142162 oracle_java_rpm_validate_certs : yes
143- oracle_java_set_as_default : yes
144- oracle_java_version_string : 10.0.2
163+ oracle_java_set_as_default : no
164+ oracle_java_version_string : 1.8.0_181
145165` ` `
146166
147167Use ` --skip-tags=debug` if you want to suppress debug information.
148-
149- ` ` ` yaml
150- # URLs from where you can download the RPM
151- redhat:
152- 10.0.2: http://download.oracle.com/otn-pub/java/jdk/10.0.2+13/19aef61b38124481863b1413dce1855f/jdk-10.0.2_linux-x64_bin.rpm
153168```
154169
155170## Test
0 commit comments