Created
July 24, 2013 10:45
-
-
Save owainlewis/6069582 to your computer and use it in GitHub Desktop.
Install Java 7 with Ansible on Ubuntu Linux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- 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 |
Thanks it worked for me too, for java 8 ... just by making some small changes.
ERROR! 'apt' is not a valid attribute for a Play
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To make it working (Ubuntu 14.04 LTS) I had to change a detail:
with
Thanks a lot.