Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to auto accept terms while installing packages with Ansible?

Tags:

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
like image 673
Siva Avatar asked Nov 20 '17 09:11

Siva


People also ask

How do I install Ansible packages?

Package installation is a relatively simple task and only requires two elements. The state option instructs Ansible to check whether or not some package is present on the system, and the name option lists which packages to look for. Ansible deals in machine state, so module instructions always imply change.

What does become Yes mean in Ansible playbooks?

What does 'become: yes' mean in Ansible playbooks? command must be retried until it succeeds. service needs to be started once installed. we would run all commands as root. worker node should become a manager node.

Which Ansible command would you use to run a playbook named install Yaml?

To run a playbook, start by installing Ansible first. It includes the ansible-playbook command.


1 Answers

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
like image 138
techraf Avatar answered Oct 26 '22 09:10

techraf