@@ -45,9 +45,18 @@ DISCLAIMER: usage of any version of this role implies you have accepted the
45
45
46
46
- ** debug** : flag to make role more verbose.
47
47
- ** 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.
48
52
49
53
### Debian
50
54
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
+
51
60
- ** oracle_java_apt_repository** : Personal Package Archive (PPA) from where to install Java.
52
61
- ** oracle_java_apt_repository_key** : PPA repository key.
53
62
- ** 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
58
67
59
68
### Debian/Ubuntu
60
69
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
+
61
75
- ** oracle_java_apt_repository** : Personal Package Archive (PPA) from where to install Java.
62
76
- ** oracle_java_cache_valid_time** : the amount of time in seconds the apt cache is valid.
63
77
- ** 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
67
81
68
82
### Redhat-only
69
83
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
+
70
89
- ** oracle_java_dir_source** : directory where to store the RPM files.
71
90
- ** oracle_java_download_timeout** : download timeout, in seconds.
72
91
- ** oracle_java_home** : the location of the Java home directory.
73
92
- ** oracle_java_rpm_filename** : file name used for the download destination.
74
93
- ** oracle_java_rpm_url** : where to download the rpm from.
75
94
- ** 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.
77
95
- ** oracle_java_version_string** : the Java version string to verify installation against.
78
96
79
97
## Playbooks
@@ -88,68 +106,65 @@ DISCLAIMER: usage of any version of this role implies you have accepted the
88
106
- hosts : servers
89
107
roles :
90
108
- 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
98
114
99
115
# debian | Java 8
100
116
- hosts : servers
101
117
roles :
102
118
- role : ansiblebit.oracle-java
119
+ oracle_java_use_defaults : no
103
120
oracle_java_apt_repository : ' deb http://ppa.launchpad.net/webupd8team/java/ubuntu bionic main'
104
121
oracle_java_apt_repository_key : ' EA8CACC073C3DB2A'
105
122
oracle_java_cache_valid_time : 3600
106
123
oracle_java_deb_package : ' oracle-java8-installer'
107
124
oracle_java_debconf_package_default : ' oracle-java8-set-default'
108
125
oracle_java_home : " /usr/lib/jvm/java-8-oracle"
126
+ oracle_java_set_as_default : no
109
127
oracle_java_state : latest
110
128
111
129
# debian | ubuntu | Java 10
112
130
- hosts : servers
113
131
roles :
114
132
- 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
121
133
122
134
# debian | ubuntu | Java 8
123
135
- hosts : servers
124
136
roles :
125
137
- role : ansiblebit.oracle-java
138
+ oracle_java_use_defaults : no
126
139
oracle_java_apt_repository : " ppa:webupd8team/java"
127
140
oracle_java_cache_valid_time : 3600
128
141
oracle_java_deb_package : ' oracle-java10-installer'
129
142
oracle_java_debconf_package_default : ' oracle-java10-set-default'
130
143
oracle_java_home : " /usr/lib/jvm/java-10-oracle"
144
+ oracle_java_set_as_default : no
131
145
oracle_java_state : latest
132
146
133
147
# redhat | centos 7 | Java 10
148
+ - hosts : servers
149
+ roles :
150
+ - role : ansiblebit.oracle-java
151
+
152
+ # redhat | centos 7 | Java 8
134
153
- hosts : servers
135
154
roles :
136
155
- role : ansiblebit.oracle-java
137
156
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'
139
159
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'
142
162
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
145
165
` ` `
146
166
147
167
Use ` --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
153
168
```
154
169
155
170
## Test
0 commit comments