Skip to content

Instantly share code, notes, and snippets.

@cecepm
Last active August 23, 2018 02:52
Show Gist options
  • Select an option

  • Save cecepm/8400aacfd2d78608ffd9 to your computer and use it in GitHub Desktop.

Select an option

Save cecepm/8400aacfd2d78608ffd9 to your computer and use it in GitHub Desktop.
Ansible playbook for installing java from Webupd8team PPA.
---
- 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
apt_repository: repo='ppa:webupd8team/java'
- name: Autoaccept license for Java
debconf: name='oracle-java7-installer' question='shared/accepted-oracle-license-v1-1' value='true' vtype='select'
- name: Update APT package cache
apt: update_cache=yes
- name: Install Java 7
apt: name=oracle-java7-installer state=latest install_recommends=yes
- name: Set Java 7 Env
apt: name=oracle-java7-set-default state=latest install_recommends=yes
- hosts: all
remote_user: vagrant
sudo: yes
tasks:
- include: java.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment