Skip to content

Commit

Permalink
Implemented mandatory license check (#18)
Browse files Browse the repository at this point in the history
To use this role you must have accepted the "Oracle Binary Code License Agreement
for the Java SE Platform Products and JavaFX".

Enhancement: resolves #17
  • Loading branch information
freemanjp authored Aug 22, 2016
1 parent fa2974f commit fab12e8
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,23 @@ java_home: "{{ java_install_dir }}/jdk{{ java_version }}"
java_download_dir: "{{ x_ansible_download_dir | default('~/.ansible/tmp/downloads') }}"
```
### Oracle Binary Code License Agreement
To use this role you must accept the "Oracle Binary Code License Agreement
for the Java SE Platform Products and JavaFX"; you can do this by specifying
the following role variable:
```yaml
java_license_declaration: 'I accept the "Oracle Binary Code License Agreement for the Java SE Platform Products and JavaFX" under the terms at http://www.oracle.com/technetwork/java/javase/terms/license/index.html'
```
If you don't want to embed the declaration in your playbook it can be passed
by adding the following argument when running `ansible-playbook`:

```
--extra-vars '{"java_license_declaration": "I accept the \"Oracle Binary Code License Agreement for the Java SE Platform Products and JavaFX\" under the terms at http://www.oracle.com/technetwork/java/javase/terms/license/index.html\"}'
```
### Supported Java versions
The following versions of Java are supported without any additional
Expand Down
2 changes: 2 additions & 0 deletions molecule.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
ansible:
playbook: tests/test.yml
extra_vars:
java_license_declaration: 'I accept the "Oracle Binary Code License Agreement for the Java SE Platform Products and JavaFX" under the terms at http://www.oracle.com/technetwork/java/javase/terms/license/index.html'

docker:
containers:
Expand Down
5 changes: 5 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
- java_jce_redis_filename not in (None, '')
- java_jce_redis_folder not in (None, '')

- name: assert Binary Code License accepted
assert:
that:
- java_license_declaration == 'I accept the "Oracle Binary Code License Agreement for the Java SE Platform Products and JavaFX" under the terms at http://www.oracle.com/technetwork/java/javase/terms/license/index.html'

# Create download directory
- name: create download directory
file:
Expand Down

0 comments on commit fab12e8

Please sign in to comment.