Skip to content

Instantly share code, notes, and snippets.

@arturaz
Last active December 15, 2015 10:09
Show Gist options
  • Save arturaz/5243940 to your computer and use it in GitHub Desktop.
Save arturaz/5243940 to your computer and use it in GitHub Desktop.
Ansible task file for installing java7 on ubuntu.
---
- name: ensuring add-apt-repository is installed
apt: pkg=python-software-properties state=latest
- name: adding webupd8 ppa for java7 installer
apt_repository: repo=ppa:webupd8team/java
- name: updating apt cache
apt: update_cache=yes
- name: installing java7
# Installer is interactive so force all answers to yes.
# http://askubuntu.com/a/190674/67778
shell: echo debconf shared/accepted-oracle-license-v1-1 select true |
debconf-set-selections &&
echo debconf shared/accepted-oracle-license-v1-1 seen true |
debconf-set-selections &&
apt-get -y install oracle-java7-installer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment