smola / ansible-java-role Goto Github PK
View Code? Open in Web Editor NEWAnsible role to manage installation of OpenJDK / Oracle JDK 6, 7 and 8.
Home Page: https://galaxy.ansible.com/list#/roles/1209
License: MIT License
Ansible role to manage installation of OpenJDK / Oracle JDK 6, 7 and 8.
Home Page: https://galaxy.ansible.com/list#/roles/1209
License: MIT License
This isn't the fault of the role, but in our deployment we've noticed many times that Ubuntu's keyserver (keyserver.ubuntu.com) sometimes doesn't respond, failing the Ansible run.
Hi,
Thank you great role. Might i suggest to do releases so we can pin to specific version ?
Cheers
I get the following error when trying to install on wheezy (debian 7)
GATHERING FACTS *************************************************************** ok: [test] TASK: [smola.java | include_vars Ubuntu.yml] ********************************** ok: [test] TASK: [smola.java | Install python-apt] *************************************** ok: [test] TASK: [smola.java | Install WebUpd8 apt key] ********************************** ok: [test] TASK: [smola.java | Install WebUpd8 Team Java PPA (for Oracle Java)] ********** failed: [test] => {"failed": true, "parsed": false} Traceback (most recent call last): File "/root/.ansible/tmp/ansible-tmp-1437699050.76-118417023704279/apt_repository", line 2854, in main() File "/root/.ansible/tmp/ansible-tmp-1437699050.76-118417023704279/apt_repository", line 449, in main if state == 'present' and expanded_repo not in sourceslist.repos_urls: AttributeError: 'SourcesList' object has no attribute 'repos_urls'
Shouldn't this point at a URL or something ? https://github.com/smola/ansible-java-role/blob/master/tasks/webupd8_for_debian.yml#L3 I don't see where the noted gpg key is supposed to come from.
I'm only able to install openjdk with this Ansible role if I remove that particular task.
- name: Remove WebUpd8 Team Java PPA (for Oracle Java)
apt_repository: repo='deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main' state=present
when: java_cleanup and not java_needs_oracle
shouldn't it be state=absent?
oracle-java8-installer doesn't work.
it seems the url for java is changed.
the url in the oracle-java8-installer is required to updated.
Just tested this role on Ansible 1.5 under Debian and got the following error;
ERROR: debconf is not a legal parameter in an Ansible task or handler
Looks like this module was introduced into 1.6, so I upgraded to Ansible 1.8 and I still get the same problem.
I'm using this to provision a vagrant ubuntu/trusty64 box. Like this:
---
- name: My New Play
hosts: all
vars:
java_packages:
- openjdk-7-jre
roles:
- { role: smola.java, sudo: yes}
For some reason, the oracle javas install just fine, but the openjdk javas fail with a plethora of errors that look like this:
Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/o/openjdk-7/openjdk-7-jre-headless_7u71-2.5.3-0ubuntu0.14.04.1_amd64.deb 404 Not Found [IP: 91.189.91.23 80]
This is a problem with ubuntu's apt cache being out of date. It's easily fixed by running sudo apt-get update
, and then running the ansible playbook again.
I think the ansible-java-role
could avoid this problem by using the update_cache
option in the apt task for Ubuntu, like so:
- name: Install Java packages
apt: pkg={{ item }} state=latest update_cache=yes
with_items: java_packages
Right now my workaround is to use a pre_task, which works:
---
- name: My New Play
hosts: all
vars:
java_packages:
- openjdk-7-jre
pre_tasks:
- name: Update the apt cache
apt: update_cache=yes
sudo: yes
roles:
- { role: smola.java, sudo: yes}
Added to my playbook. Thanks Santi
So I'm an ansible newbie but was trying to get java 7 installed on a vagrant vm
vm: ubuntu/trusty64
ansible: 1.8.2
It's a simple playbook:
- hosts: all
vars:
java_packages:
- oracle-java7-installer
roles:
- { role: smola.java }
but i'm getting the errors:
TASK: [smola.java | Install WebUpd8 Team Java PPA (for Oracle Java)] **********
failed: [default] => {"cmd": "apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 7B2C3B0889BF5709A105D03AC2518248EEA14886", "failed": true, "rc": 2}
stderr: gpg: requesting key EEA14886 from hkp server keyserver.ubuntu.com
gpg: no writable keyring found: eof
gpg: error reading `[stream]': general error
gpg: Total number processed: 0
stdout: Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --homedir /tmp/tmp.aQZ7eGyxl6 --no-auto-check-trustdb --trust-model always --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 7B2C3B0889BF5709A105D03AC2518248EEA14886
msg: gpg: requesting key EEA14886 from hkp server keyserver.ubuntu.com
gpg: no writable keyring found: eof
gpg: error reading `[stream]': general error
gpg: Total number processed: 0
FATAL: all hosts have already failed -- aborting
am i missing something obvious?
thanks,
charlie
When installing oracle java 7 the JAVA_HOME is not set.
I've used:
- java_packages:
- oracle-java7-installer
roles:
- { role: smola.java }
something like this would wonderful:
- java_packages:
- oracle-java7-installer
- java_home_set: true
roles:
- { role: smola.java }
Is it possible to install Oracle JDK 8 with Java Cryptography Extension (JCE) using this role?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.