如何使用 Ansible 安装 Oracle Java 8
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/50536756/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-10 23:40:29 来源:igfitidea点击:
How to install Oracle Java 8 using Ansible
提问by user2066480
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
This installer has 2 full screen prompts and ansible fails when trying to install this package.
此安装程序有 2 个全屏提示,尝试安装此软件包时 ansible 失败。
- name: Add Oracle Java PPA
apt_repository:
repo: ppa:webupd8team/java
state: present
- name: Install Java 8
apt:
name: oracle-java8-installer
update_cache: yes
回答by user2066480
https://github.com/malk/ansible-java8-oracle
https://github.com/malk/ansible-java8-oracle
---
- name: Install add-apt-repostory
become: yes
apt: name=software-properties-common state=latest
- name: Add Oracle Java Repository
become: yes
apt_repository: repo='ppa:webupd8team/java'
- name: Accept Java 8 License
become: yes
debconf: name='oracle-java8-installer' question='shared/accepted-oracle-license-v1-1' value='true' vtype='select'
- name: Install Oracle Java 8
become: yes
apt: name={{item}} state=latest
with_items:
- oracle-java8-installer
- ca-certificates
- oracle-java8-set-default