Created
June 16, 2014 11:21
-
-
Save andershedstrom/7c7d0bb5b9450c54a907 to your computer and use it in GitHub Desktop.
Revisions
-
andershedstrom created this gist
Jun 16, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,26 @@ --- - hosts: app remote_user: vagrant sudo: yes vars: download_url: http://download.oracle.com/otn-pub/java/jdk/8u5-b13/jdk-8u5-linux-x64.tar.gz download_folder: /opt java_name: "{{download_folder}}/jdk1.8.0_05" java_archive: "{{download_folder}}/jdk-8u5-linux-x64.tar.gz" tasks: - name: Download Java command: "wget -q -O {{java_archive}} --no-check-certificate --no-cookies --header 'Cookie: oraclelicense=accept-securebackup-cookie' {{download_url}} creates={{java_archive}}" - name: Unpack archive command: "tar -zxf {{java_archive}} -C {{download_folder}} creates={{java_name}}" - name: Fix ownership file: state=directory path={{java_name}} owner=root group=root recurse=yes - name: Make Java available for system command: 'alternatives --install "/usr/bin/java" "java" "{{java_name}}/bin/java" 2000' - name: Clean up file: state=absent path={{java_archive}}