使用 Ansible 安装软件包时如何自动接受条款? [英] How to auto accept terms while installing packages with Ansible?

查看:31
本文介绍了使用 Ansible 安装软件包时如何自动接受条款?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

安装 pkgs Ansible 失败,因为需要接受许可条款.

While installing pkgs Ansible fails, because there is a need to accept licensing terms.

如何通过ansible-playbook自动接受条款?

How to auto accept terms through ansible-playbook?

---
- hosts: client1
  remote_user: ansible
  become: True
  tasks:
    - name: testing
      apt_repository: repo=ppa:webupd8team/java state=present
    - name: updating
      apt: update_cache=yes
    - name: installaing oracle pkg
      apt: pkg=oracle-java8-installer state=present update_cache=yes

推荐答案

包"没有通用的方法.

对于 Oracle Java,在调用 apt 之前添加一个任务:

For Oracle Java add a task before calling apt:

- debconf:
    name: oracle-java8-installer
    question: shared/accepted-oracle-license-v1-1
    value: true
    vtype: select

这篇关于使用 Ansible 安装软件包时如何自动接受条款?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆