Skip to content

Instantly share code, notes, and snippets.

@rothgar
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rothgar/9082906 to your computer and use it in GitHub Desktop.
Save rothgar/9082906 to your computer and use it in GitHub Desktop.
Download Java with Ansible
# from vars file
java_version: '7u51'
java_build: 'b13'
jdk_or_jre: jre
openjdk: False
# tasks/main.yml
- name: Download Java
shell: 'wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com"
"http://download.oracle.com/otn-pub/java/jdk/{{ java_version }}-{{ java_build }}/{{ jdk_or_jre }}-{{ java_version }}-linux-x{{ ansible_userspace_bits }}.tar.gz"
-O /tmp/{{ jdk_or_jre }}_{{ java_version }}.tar.gz creates=/tmp/{{ jdk_or_jre }}_{{ java_version }}.tar.gz'
register: jdk_downloaded
when: openjdk|bool
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment