---
# file: roles/oracle_jdk/tasks/main.yml

- name: install Oracle Java 7 JDK via apt
  apt: pkg={{ item }}
  with_items:
       - oracle-java7-jdk
  sudo: yes
  tags:
    - java

---
# file: roles/oracle_jdk/tasks/main.yml

- name: install Oracle Java 7 JDK via apt
  apt: pkg={{ item }}
  with_items:
       - oracle-java7-jdk
  sudo: yes
  tags:
    - java

- name: set JAVA_HOME
  lineinfile: dest=/etc/environment state=present
    regexp="^JAVA_HOME="
    line="JAVA_HOME=/usr/lib/jvm/java-7-oracle"
  tags:
    - java

Set JAVA_HOME in oracle_jdk task.
Set JAVA_HOME in oracle_jdk task.
