summaryrefslogtreecommitdiff
path: root/playbooks/openjdk.yaml
diff options
context:
space:
mode:
authorCarlos Konstanski <ckonstanski@pippiandcarlos.com>2017-11-13 16:50:55 -0700
committerCarlos Konstanski <ckonstanski@pippiandcarlos.com>2017-11-13 16:50:55 -0700
commitffa2a169ea98fb54a29d90ca158059e79e2816ba (patch)
tree018461d031b71178fa48b9672d8e39bac4de1270 /playbooks/openjdk.yaml
initial commit
Diffstat (limited to 'playbooks/openjdk.yaml')
-rw-r--r--playbooks/openjdk.yaml59
1 files changed, 59 insertions, 0 deletions
diff --git a/playbooks/openjdk.yaml b/playbooks/openjdk.yaml
new file mode 100644
index 0000000..00c7d90
--- /dev/null
+++ b/playbooks/openjdk.yaml
@@ -0,0 +1,59 @@
+---
+- name: "Install openjdk"
+ hosts: target
+ tasks:
+ - name: "Update apt"
+ apt:
+ update_cache: yes
+ when: ansible_distribution == "Ubuntu"
+
+ - name: "Install openjdk package"
+ apt:
+ pkg: "{{ item }}"
+ state: present
+ with_items:
+ - openjdk-8-jdk-headless
+ when: ansible_distribution == "Ubuntu"
+
+ - name: "Update yum cache"
+ yum:
+ update_cache: yes
+ when: ansible_distribution == "RedHat" or ansible_distribution == "CentOS"
+
+ - name: "Install openjdk package"
+ yum:
+ name: "{{ item }}"
+ state: present
+ with_items:
+ - openjdk
+ when: ansible_distribution == "RedHat" or ansible_distribution == "CentOS"
+
+ - name: "Install icedtea package"
+ portage:
+ name: "{{ item }}"
+ state: present
+ with_items:
+ - dev-java/icedtea:8
+ when: ansible_distribution == "Gentoo"
+
+ - name: "Set icedtea-8 as default java"
+ shell: java-config -S icedtea-8
+ when: ansible_distribution == "Gentoo"
+
+ - name: "/dev/urandom fix"
+ lineinfile:
+ dest: "/etc/java-8-openjdk/security/java.security"
+ regexp: "{{ item.regexp }}"
+ line: "{{ item.line }}"
+ with_items:
+ - { regexp: '^securerandom.source=file:/dev/random.*$', line: "securerandom.source=file:/dev/urandom" }
+ when: ansible_distribution == "Ubuntu"
+
+ - name: "/dev/urandom fix"
+ lineinfile:
+ dest: "/etc/java-config-2/current-system-vm/jre/lib/security/java.security"
+ regexp: "{{ item.regexp }}"
+ line: "{{ item.line }}"
+ with_items:
+ - { regexp: '^securerandom.source=file:/dev/random.*$', line: "securerandom.source=file:/dev/urandom" }
+ when: ansible_distribution == "Gentoo"