Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours on Instagram and YouTube and waste money on coffee and fast food, but won’t spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!

Learn from Guru Rajesh Kumar and double your salary in just one year.


Get Started Now!

Ansible Variable: How to declare Variables in Ansible Inventory or hosts file?

Example


# user & passowd & sudo without password
[web]			
1.2.3.4	mynameinv=Rajesh in inventory	
1.2.3.5		
1.2.3.6		
1.2.3.7

[web:vars]
ansible_user=user1 
ansible_ssh_pass=pass1 
ansible_become=yes

# user & key & sudo with password
[app]			
2.2.3.4	mynameinv=Rajesh in inventory 		
3.2.3.5		
4.2.3.6
5.2.3.7

[app:vars]
ansible_user=user1  
ansible_ssh_private_key_file=node.pem 
ansible_become=yes 
ansible_become_pass=pass123

# user & key & sudo with Diff user and password
[log]			
6.2.3.4 ansible_user=user1 ansible_ssh_private_key_file=node.pem ansible_become=yes ansible_become_user=user2 ansible_become_pass=pas122
7.2.3.5
8.2.3.6
9.2.3.7

# user & pass & sudo with Diff user and password
[db]			
6.2.3.1 ansible_user=user1 ansible_ssh_pass=pass1 ansible_become=yes ansible_become_user=user2 ansible_become_pass=pass2
7.2.3.2
8.2.3.3
9.2.3.4
DevOps Certification, SRE Certification, and DevSecOps Certification by DevOpsSchool

Explore our DevOps Certification, SRE Certification, and DevSecOps Certification programs at DevOpsSchool. Gain the expertise needed to excel in your career with hands-on training and globally recognized certifications.