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
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? 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.
To run a playbook, start by installing Ansible first. It includes the ansible-playbook command.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With