Skip to content

Instantly share code, notes, and snippets.

@t2d
Forked from owainlewis/java7.yml
Last active August 29, 2015 14:08
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 t2d/b875eb1a6dbc97a81113 to your computer and use it in GitHub Desktop.
Save t2d/b875eb1a6dbc97a81113 to your computer and use it in GitHub Desktop.
---
- name: ensure required packages are installed for Java 7
apt: name=$item state=latest update_cache=yes
with_items:
- python-software-properties
- name: Add Java repository to sources
action: apt_repository repo='ppa:webupd8team/java'
- name: Autoaccept license for Java
action: shell echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections
- name: Update APT package cache
action: apt update_cache=yes
- name: Install Java 7
action: apt pkg=oracle-java7-installer state=latest install_recommends=yes
- name: Set Java 7 Env
action: apt pkg=oracle-java7-set-default state=latest install_recommends=yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment