Skip to content

Instantly share code, notes, and snippets.

@labynocle
Last active July 1, 2017 08:18
Show Gist options
  • Save labynocle/6a3269f70329c05a3defec7c0e7fe15d to your computer and use it in GitHub Desktop.
Save labynocle/6a3269f70329c05a3defec7c0e7fe15d to your computer and use it in GitHub Desktop.
Ansible for java 8 on Ubuntu
---
- name: Add Java repository
apt_repository:
repo: "ppa:webupd8team/java"
become: yes
- name: Force apt cache update
apt:
update_cache: yes
become: yes
- name: Set Java 8 License as selected
shell: "/bin/echo debconf shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections"
become: yes
- name: Set Java 8 License as seen
shell: "/bin/echo debconf shared/accepted-oracle-license-v1-1 seen true | /usr/bin/debconf-set-selections"
become: yes
- name: Install Oracle Java 8
apt:
name: "{{item}}"
state: latest
with_items:
- oracle-java8-installer
- ca-certificates
- oracle-java8-set-default
become: yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment