diff --git a/README.md b/README.md index 3556250..2fb1b55 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,12 @@ java_set_javahome: false # install JCE? java_install_jce: false + +# use internal proxy url for instances behind a firewall +java_use_proxy: true + +# url to use when proxy is true, usually a nexus proxy +java_proxy_url: ``` For other configurable internals, read `tasks/set-role-variables.yml` file; for example, supported `java_version`/`java_subversion` combinations. @@ -72,7 +78,7 @@ If you want to install a Java release which is not supported out-of-the-box, you ### Customized variables, if absolutely necessary -If you have a pre-downloaded `jdk_tarball_file` whose filename cannot be inferred successfully by `tasks/set-role-variables.yml`, you may specify it explicitly: +If you have a pre-downloaded `jdk_tarball_file` whose filename cannot be inferred successfully by `tasks/set-role-variables.yml`, you may specify it explicitly: ```yaml # Specify the pre-fetch filename (without tailing .tar.gz or .rpm or .dmg); diff --git a/defaults/main.yml b/defaults/main.yml index c0da713..ac0b2ac 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -19,3 +19,6 @@ java_remove_download: true java_install_jce: false java_set_javahome: false +java_use_proxy: false +java_remote_url: "http://download.oracle.com/otn-pub" +java_proxy_url: diff --git a/tasks/set-role-variables.yml b/tasks/set-role-variables.yml index 9105e02..826cc09 100644 --- a/tasks/set-role-variables.yml +++ b/tasks/set-role-variables.yml @@ -8,7 +8,15 @@ set_fact: jdk_version: "1.{{ java_version }}.0_{{ java_subversion }}" +- name: set remote java url + set_fact: + java_url: "{{java_remote_url}}" + when: "{{java_use_proxy}} == false" +- name: set proxy java url + set_fact: + java_url: "{{java_proxy_url}}" + when: "{{java_use_proxy}} == true" # # platform-specific variables # @@ -129,7 +137,7 @@ - name: compose url for downloading file, if necessary set_fact: - jdk_tarball_url: "http://download.oracle.com/otn-pub/java/jdk/{{ jdk_version_detail }}/{{ jdk_tarball_file }}" + jdk_tarball_url: "{{ java_url }}/java/jdk/{{ jdk_version_detail }}/{{ jdk_tarball_file }}" when: jdk_version_detail is defined @@ -151,8 +159,7 @@ - name: set JCE download file set_fact: - jce_zip_url: "http://download.oracle.com/otn-pub/java/jce/{{ java_version }}/{{ jce_zip_file }}" - + jce_zip_url: "{{java_url}}/java/jce/{{ java_version }}/{{ jce_zip_file }}" # # directories