In Ansible I found some keywords like become and become_user. I am implementing ansible by making server01 as ansible control node (from where I will write playbooks and will execute playbooks on other remote server/s) and server02 as remote node.
server01 - Ansible control node Users of server01 - root, vagrant
server02 - Ansible remote node Users of server02 - root, test
Note: I am able to ssh server02 using it's test user.
Suppose I have written a playbook for "tree" installation on server02.
---
- name: Installation of software on ubuntu server
hosts: PROD
become: true
tasks:
- name: Install tree software
apt:
name: tree
state: present
update_cache: yes
Now, I have executed the playbook and I want to know the significance of become keyword.
From which user server01 ansible-playbook will login into the server02. and why I used become keyword. Please also write about become_user keyword?