ansible install java 8
tasks:
- name: add repo for java 8
apt_repository: repo='ppa:webupd8team/java' state=present
- name: set licence selected
shell: /bin/echo debconf shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections
sudo: yes
- name: set licence seen
shell: /bin/echo debconf shared/accepted-oracle-license-v1-1 seen true | /usr/bin/debconf-set-selections
sudo: yes
- name: install java 8
apt: name=oracle-java8-installer state=latest update-cache=yes force=yes
sudo: yes
Written by Paul Felby
Related protips
2 Responses
Instead of using two times shell command, we can use the debconf module to accept the licence.
debconf: name='oracle-java8-installer' question='shared/accepted-oracle-license-v1-1' value='true' vtype='select'
Thanks
over 1 year ago
·
thanks, very useful !
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Linux
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#