Skip to content

Instantly share code, notes, and snippets.

@luzfcb
Forked from fclairamb/install_java.yml
Last active August 29, 2015 14:06
Show Gist options
  • Save luzfcb/f7cfcf703b85dde97a36 to your computer and use it in GitHub Desktop.
Save luzfcb/f7cfcf703b85dde97a36 to your computer and use it in GitHub Desktop.
- 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