Siva
Siva

Reputation: 65

How to auto accept terms while installing packages with Ansible?

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

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

Upvotes: 5

Views: 2695

Answers (2)

DBLaci
DBLaci

Reputation: 44

For virtualbox-ext-pack

- debconf:
    name: virtualbox-ext-pack
    question: virtualbox-ext-pack/license
    value: "true"
    vtype: select

before apt install command.

Upvotes: 2

techraf
techraf

Reputation: 68629

There is no universal method for "packages".

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

Upvotes: 6

Related Questions