Created
April 7, 2013 15:58
-
-
Save fclairamb/5331052 to your computer and use it in GitHub Desktop.
Ansible playbook to install Java automatically on Debian. I'm pretty sure you have to read and accept the java license before installing this. Using apt module surely is better but it requires to have python-apt installed.
This file contains 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 characters
- name: Java install | |
hosts: do | |
user: root | |
tasks: | |
- name: Create java repo list | |
action: shell echo 'deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main' >/etc/apt/sources.list.d/java.list | |
- name: Add repo key | |
action: command apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886 | |
- name: Accept java license | |
action: shell echo 'oracle-java7-installer shared/accepted-oracle-license-v1-1 select true' | debconf-set-selections | |
- name: Update | |
action: command apt-get update -y | |
- name: Install java 7 | |
action: command apt-get install oracle-java7-set-default -y |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment